summaryrefslogtreecommitdiff
path: root/ao_panic.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-04-14 21:25:15 -0700
committerKeith Packard <keithp@keithp.com>2009-04-14 21:25:15 -0700
commit4d1091d9bd121f05f5fe0a9c9d2bc0da8c562b9a (patch)
treebba8f2b2b3cb4bce6052e0bfffa380c8dfefcecf /ao_panic.c
parent545478dd02eaeff6a65d318e722b1e4fce5e01b4 (diff)
Slow down panic code, disable interrupts
Diffstat (limited to 'ao_panic.c')
-rw-r--r--ao_panic.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ao_panic.c b/ao_panic.c
index 30ccce60..b486aefb 100644
--- a/ao_panic.c
+++ b/ao_panic.c
@@ -20,11 +20,12 @@
static void
ao_panic_delay(uint8_t n)
{
- uint8_t i = 0;
+ uint8_t i = 0, j = 0;
while (n--)
- while (--i)
- _asm nop _endasm;
+ while (--j)
+ while (--i)
+ _asm nop _endasm;
}
void
@@ -32,7 +33,7 @@ ao_panic(uint8_t reason)
{
uint8_t n;
- for (;;) {
+ __critical for (;;) {
ao_led_on(AO_LED_RED);
ao_beep(AO_BEEP_MID);
ao_panic_delay(2);