altos: Add pragma to eliminate unreachable code warning on SDCC
[fw/altos] / src / core / ao_panic.c
index cbfdf3999e01f17d3343c31dbb45b8a42066e372..244917a8af9a32a44c0bc1bc756bee7f00750f90 100644 (file)
 #if !HAS_BEEP
 #define ao_beep(x)
 #endif
+#if !LEDS_AVAILABLE
+#define ao_led_on(x)
+#define ao_led_off(x)
+#endif
 
 static void
 ao_panic_delay(uint8_t n)
@@ -53,7 +57,10 @@ 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);