X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fcore%2Fao_report.c;h=eb90a4f8c6eb99b62dc83dbb71d33c6b8530d528;hb=84f9a525c64491afa9b7a565e3c10a4cee106e14;hp=70f0b49d1174058fbbb9401b8ca582cbc145f3d9;hpb=128bbfa150f88c09f7adde2434b7bf0b5a9ed556;p=fw%2Faltos diff --git a/src/core/ao_report.c b/src/core/ao_report.c index 70f0b49d..eb90a4f8 100644 --- a/src/core/ao_report.c +++ b/src/core/ao_report.c @@ -16,6 +16,8 @@ */ #include "ao.h" +#include +#include #define BIT(i,x) ((x) ? (1 << (i)) : 0) #define MORSE1(a) (1 | BIT(3,a)) @@ -99,14 +101,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 +157,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 +176,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; } }