summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-11-12 18:52:02 -0800
committerKeith Packard <keithp@keithp.com>2011-11-12 18:52:02 -0800
commitd3dcb9451f40506abced72783966104645a73bc7 (patch)
treed662ce63d2b074988c79276593fbcfb1dbfde307
parent0f7d7a4fbede63b51208bf051e08aa73dfbf35a0 (diff)
altos: Allow TT/TBT reports to escape landed state
The TM altitude reporting code kept beeping out state and altitude forever, which isn't very useful on TBT or TT. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/core/ao_report.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/core/ao_report.c b/src/core/ao_report.c
index 70f0b49d..7c928792 100644
--- a/src/core/ao_report.c
+++ b/src/core/ao_report.c
@@ -99,14 +99,10 @@ ao_report_altitude(void)
agl /= 10;
} while (agl);
- for (;;) {
- ao_report_beep();
- i = ndigits;
- do
- ao_report_digit(digits[--i]);
- while (i != 0);
- pause(AO_SEC_TO_TICKS(5));
- }
+ i = ndigits;
+ do
+ ao_report_digit(digits[--i]);
+ while (i != 0);
}
#if HAS_IGNITE_REPORT
@@ -159,9 +155,14 @@ ao_report(void)
{
ao_report_state = ao_flight_state;
for(;;) {
- if (ao_flight_state == ao_flight_landed)
- ao_report_altitude();
ao_report_beep();
+ if (ao_flight_state == ao_flight_landed) {
+ ao_report_altitude();
+#if HAS_FLIGHT
+ ao_delay(AO_SEC_TO_TICKS(5));
+ continue;
+#endif
+ }
#if HAS_IGNITE_REPORT
if (ao_flight_state == ao_flight_idle)
ao_report_continuity();
@@ -173,11 +174,10 @@ ao_report(void)
pause(AO_MS_TO_TICKS(100));
}
#endif
- __critical {
- while (ao_report_state == ao_flight_state)
- ao_sleep(DATA_TO_XDATA(&ao_flight_state));
- ao_report_state = ao_flight_state;
- }
+
+ while (ao_report_state == ao_flight_state)
+ ao_sleep(DATA_TO_XDATA(&ao_flight_state));
+ ao_report_state = ao_flight_state;
}
}