test/ao_flight_test: Show recorded pyro firing
authorKeith Packard <keithp@keithp.com>
Tue, 12 Sep 2017 22:47:43 +0000 (15:47 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 18 Sep 2017 16:59:24 +0000 (09:59 -0700)
Can compare with computed values.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/test/ao_flight_test.c

index 8e69730ee54e1f73322de422ef677a44d9001cd7..298848d6a46b4a7921bd8fddb9ba4605020e3e25 100644 (file)
@@ -344,8 +344,10 @@ struct ao_cmds {
 #include <ao_ms5607.h>
 struct ao_ms5607_prom  ao_ms5607_prom;
 #include "ao_ms5607_convert.c"
+#if TELEMEGA
 #define AO_PYRO_NUM    4
 #include <ao_pyro.h>
+#endif
 #else
 #include "ao_convert.c"
 #endif
@@ -427,6 +429,9 @@ static double       ao_test_landed_time;
 static int     landed_set;
 static double  landed_time;
 static double  landed_height;
+#if AO_PYRO_NUM
+static uint16_t        pyros_fired;
+#endif
 
 #if HAS_MPU6000
 static struct ao_mpu6000_sample        ao_ground_mpu6000;
@@ -825,6 +830,10 @@ ao_sleep(void *wchan)
                                                ao_insert();
                                                return;
                                        case AO_LOG_TEMP_VOLT:
+                                               if (pyros_fired != log_mega->u.volt.pyro) {
+                                                       printf("pyro changed %x -> %x\n", pyros_fired, log_mega->u.volt.pyro);
+                                                       pyros_fired = log_mega->u.volt.pyro;
+                                               }
                                                break;
                                        case AO_LOG_GPS_TIME:
                                                ao_gps_prev = ao_gps_static;