altos: don't beep igniter continuity for telenano
[fw/altos] / src / core / ao_report.c
index 3cf558e1d97ff9d72018fe0f14167f2c6702d9e1..70f0b49d1174058fbbb9401b8ca582cbc145f3d9 100644 (file)
@@ -109,7 +109,7 @@ ao_report_altitude(void)
        }
 }
 
-#if HAS_IGNITE
+#if HAS_IGNITE_REPORT
 static uint8_t
 ao_report_igniter_ready(enum ao_igniter igniter)
 {
@@ -119,7 +119,13 @@ ao_report_igniter_ready(enum ao_igniter igniter)
 static void
 ao_report_continuity(void) __reentrant
 {
-       uint8_t c = (ao_report_igniter_ready(ao_igniter_drogue) |
+       uint8_t c;
+
+#if !HAS_IGNITE
+       if (!ao_igniter_present)
+               return;
+#endif
+       c = (ao_report_igniter_ready(ao_igniter_drogue) |
                     (ao_report_igniter_ready(ao_igniter_main) << 1));
        if (c) {
                while (c--) {
@@ -133,6 +139,7 @@ ao_report_continuity(void) __reentrant
                        low(AO_MS_TO_TICKS(20));
                }
        }
+#if HAS_LOG
        if (ao_log_full()) {
                pause(AO_MS_TO_TICKS(100));
                c = 2;
@@ -143,9 +150,7 @@ ao_report_continuity(void) __reentrant
                        mid(AO_MS_TO_TICKS(100));
                }
        }
-       c = 50;
-       while (c-- && ao_flight_state == ao_flight_pad)
-               pause(AO_MS_TO_TICKS(100));
+#endif
 }
 #endif
 
@@ -157,11 +162,16 @@ ao_report(void)
                if (ao_flight_state == ao_flight_landed)
                        ao_report_altitude();
                ao_report_beep();
-#if HAS_IGNITE
+#if HAS_IGNITE_REPORT
                if (ao_flight_state == ao_flight_idle)
                        ao_report_continuity();
-               while (ao_flight_state == ao_flight_pad)
+               while (ao_flight_state == ao_flight_pad) {
+                       uint8_t c;
                        ao_report_continuity();
+                       c = 50;
+                       while (c-- && ao_flight_state == ao_flight_pad)
+                               pause(AO_MS_TO_TICKS(100));
+               }
 #endif
                __critical {
                        while (ao_report_state == ao_flight_state)