projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Abort radio receive when using flash memory on megametrum
[fw/altos]
/
src
/
core
/
ao_panic.c
diff --git
a/src/core/ao_panic.c
b/src/core/ao_panic.c
index fdada201572c38e19e8adac2b6d9c7ad23414109..25dc145eea69ecd9c3b7320bee32a4b43b3f67f7 100644
(file)
--- a/
src/core/ao_panic.c
+++ b/
src/core/ao_panic.c
@@
-24,6
+24,10
@@
#if !HAS_BEEP
#define ao_beep(x)
#endif
#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)
static void
ao_panic_delay(uint8_t n)
@@
-33,7
+37,7
@@
ao_panic_delay(uint8_t n)
while (n--)
while (--j)
while (--i)
while (n--)
while (--j)
while (--i)
-
_asm nop _endasm
;
+
ao_arch_nop()
;
}
void
}
void
@@
-41,6
+45,10
@@
ao_panic(uint8_t reason)
{
uint8_t n;
{
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++) {
__critical for (;;) {
ao_panic_delay(20);
for (n = 0; n < 5; n++) {
@@
-53,7
+61,10
@@
ao_panic(uint8_t reason)
}
ao_beep(AO_BEEP_OFF);
ao_panic_delay(2);
}
ao_beep(AO_BEEP_OFF);
ao_panic_delay(2);
+
+#ifdef SDCC
#pragma disable_warning 126
#pragma disable_warning 126
+#endif
for (n = 0; n < reason; n++) {
ao_led_on(AO_LED_RED);
ao_beep(AO_BEEP_MID);
for (n = 0; n < reason; n++) {
ao_led_on(AO_LED_RED);
ao_beep(AO_BEEP_MID);