summaryrefslogtreecommitdiff
path: root/ao_panic.c
diff options
context:
space:
mode:
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);