altos/easymotor-v2: Beep out 'pad mode' repeatedly
authorKeith Packard <keithp@keithp.com>
Mon, 24 Aug 2020 00:32:41 +0000 (18:32 -0600)
committerKeith Packard <keithp@keithp.com>
Thu, 22 Oct 2020 04:33:58 +0000 (21:33 -0700)
Easymotor doesn't have igniters, so it would have been silent on the
pad, which seems bad. Add HAS_PAD_REPORT code which beeps out 'pad'
once every five seconds.

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

index 8930a46e110916d634da819c930751dd2a8b7430..8d55c387b34902883fe7f53a53ce16a56224ef5a 100644 (file)
@@ -67,6 +67,7 @@
 #define AO_PA11_PA12_RMP       1
 #define HAS_BEEP               1
 #define HAS_BATTERY_REPORT     1
+#define HAS_PAD_REPORT         1
 #define BEEPER_CHANNEL         3
 #define BEEPER_TIMER           2
 #define BEEPER_PORT            (&stm_gpioa)
index 26604d1ad4d784a96318dae4e8115327fe702cbc..831ba874cc3656d312aca76ff2409cbb03e8a7fa 100644 (file)
@@ -285,6 +285,15 @@ ao_report(void)
                        while (c-- && ao_flight_state == ao_flight_pad)
                                pause(AO_MS_TO_TICKS(100));
                }
+#endif
+#if HAS_PAD_REPORT
+               while (ao_flight_state == ao_flight_pad) {
+                       uint8_t c;
+                       ao_report_flight_state();
+                       c = 50;
+                       while (c-- && ao_flight_state == ao_flight_pad)
+                               pause(AO_MS_TO_TICKS(100));
+               }
 #endif
                while (ao_report_state == ao_flight_state)
                        ao_sleep(&ao_flight_state);