altos: Make beep reporting of igniters work with just pyro channels easytimer
authorKeith Packard <keithp@keithp.com>
Thu, 7 May 2020 05:44:34 +0000 (22:44 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 7 May 2020 05:44:34 +0000 (22:44 -0700)
Just shuffle code around to allow no apogee/main but some pyro
channels and still make beeps.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/easytimer-v1/ao_pins.h
src/kernel/ao_report.c

index 593119b94a6afbd3c92236bcbd275135dbd45c31..3ceb49f3c73a79f17e8a223dfe250f71d0ed2ed2 100644 (file)
  */
 
 #define HAS_IGNITE             0
-#define HAS_IGNITE_REPORT      0
+#define HAS_IGNITE_REPORT      1
 #define AO_PYRO_NUM            2
 
 #define AO_SENSE_PYRO(p,n)     ((p)->adc.sense[n])
index 75f0fcb29fbf594cbe31ea0038f3ef494104ccfa..26604d1ad4d784a96318dae4e8115327fe702cbc 100644 (file)
@@ -190,6 +190,7 @@ ao_report_battery(void)
 #endif
 
 #if HAS_IGNITE_REPORT
+#if HAS_IGNITE
 static uint8_t
 ao_report_igniter_ready(enum ao_igniter igniter)
 {
@@ -202,12 +203,14 @@ ao_report_igniter(void)
        return (ao_report_igniter_ready(ao_igniter_drogue) |
                     (ao_report_igniter_ready(ao_igniter_main) << 1));
 }
+#endif
 
 static void
 ao_report_continuity(void) 
 {
+       uint8_t c;
 #if HAS_IGNITE
-       uint8_t c = ao_report_igniter();
+       c = ao_report_igniter();
        if (c) {
                while (c--) {
                        high(AO_MS_TO_TICKS(25));