When debugging, send ao_panic message to ao_debug_out
[fw/altos] / src / core / ao_panic.c
index b6ff65cccd9f18e46263407cc6d047fcfcf8ee7c..25dc145eea69ecd9c3b7320bee32a4b43b3f67f7 100644 (file)
@@ -45,6 +45,10 @@ ao_panic(uint8_t reason)
 {
        uint8_t n;
 
+#if LOW_LEVEL_DEBUG
+       ao_cur_task = NULL;
+       printf ("panic %d\n", reason);
+#endif
        __critical for (;;) {
                ao_panic_delay(20);
                for (n = 0; n < 5; n++) {
@@ -58,6 +62,9 @@ ao_panic(uint8_t reason)
                ao_beep(AO_BEEP_OFF);
                ao_panic_delay(2);
 
+#ifdef SDCC
+#pragma disable_warning 126
+#endif
                for (n = 0; n < reason; n++) {
                        ao_led_on(AO_LED_RED);
                        ao_beep(AO_BEEP_MID);