altos,altosui: Add pyro state logging for TeleMega
authorKeith Packard <keithp@keithp.com>
Mon, 27 May 2013 01:03:12 +0000 (19:03 -0600)
committerKeith Packard <keithp@keithp.com>
Mon, 27 May 2013 01:03:12 +0000 (19:03 -0600)
Only in the log file (no obvious space in the telem packets), but at
least we should be able to check for pyro failures.

Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosEepromMega.java
src/core/ao_log.h
src/core/ao_log_mega.c
src/core/ao_pyro.c
src/core/ao_pyro.h

index b077e26cefd582d104963478d7eab42c633d06bd..0804c3924516f0ed6f8b38e099e930d39fabe1a2 100644 (file)
@@ -73,6 +73,7 @@ public class AltosEepromMega {
        public int v_pbatt() { return data16(2); }
        public int nsense() { return data16(4); }
        public int sense(int i) { return data16(6 + i * 2); }
        public int v_pbatt() { return data16(2); }
        public int nsense() { return data16(4); }
        public int sense(int i) { return data16(6 + i * 2); }
+       public int pyro() { return data16(26); }
 
        /* AO_LOG_GPS_TIME elements */
        public int latitude() { return data32(0); }
 
        /* AO_LOG_GPS_TIME elements */
        public int latitude() { return data32(0); }
index e1461a14a3f0137871d71807dc5cef1daf1beeed..dce12f02279a19ae7c44acb4f5382dad1e68799e 100644 (file)
@@ -236,7 +236,8 @@ struct ao_log_mega {
                        int16_t         v_pbatt;        /* 6 */
                        int16_t         n_sense;        /* 8 */
                        int16_t         sense[10];      /* 10 */
                        int16_t         v_pbatt;        /* 6 */
                        int16_t         n_sense;        /* 8 */
                        int16_t         sense[10];      /* 10 */
-               } volt;                                 /* 30 */
+                       uint16_t        pyro;           /* 30 */
+               } volt;                                 /* 32 */
                /* AO_LOG_GPS_TIME */
                struct {
                        int32_t         latitude;       /* 4 */
                /* AO_LOG_GPS_TIME */
                struct {
                        int32_t         latitude;       /* 4 */
index abf953a6b7c051337eea644c0b0fe49758589141..0db1119cfb96e8d9188c58fdfff2e3ccbff11933 100644 (file)
@@ -151,6 +151,7 @@ ao_log(void)
                                log.u.volt.n_sense = AO_ADC_NUM_SENSE;
                                for (i = 0; i < AO_ADC_NUM_SENSE; i++)
                                        log.u.volt.sense[i] = ao_data_ring[ao_log_data_pos].adc.sense[i];
                                log.u.volt.n_sense = AO_ADC_NUM_SENSE;
                                for (i = 0; i < AO_ADC_NUM_SENSE; i++)
                                        log.u.volt.sense[i] = ao_data_ring[ao_log_data_pos].adc.sense[i];
+                               log.u.pyro = ao_pyro_fired;
                                ao_log_mega(&log);
                                next_other = log.tick + AO_OTHER_INTERVAL;
                        }
                                ao_log_mega(&log);
                                next_other = log.tick + AO_OTHER_INTERVAL;
                        }
index b655eaca076d596f55e68d927751dad3cc81d340..b3cda656a7e7b8299a7cfce7c0082d83f0f35461 100644 (file)
@@ -33,6 +33,8 @@
 
 #define ao_lowbit(x)   ((x) & (-x))
 
 
 #define ao_lowbit(x)   ((x) & (-x))
 
+uint16_t       ao_pyro_fired;
+
 /*
  * Given a pyro structure, figure out
  * if the current flight state satisfies all
 /*
  * Given a pyro structure, figure out
  * if the current flight state satisfies all
index cde850add58eab6a2d8d2903820e6f2d44b11f9a..1f8385426753cde410c533b00f516a810c64f2eb 100644 (file)
@@ -63,6 +63,8 @@ struct ao_pyro {
 
 extern uint8_t ao_pyro_wakeup;
 
 
 extern uint8_t ao_pyro_wakeup;
 
+extern uint16_t        ao_pyro_fired;
+
 void
 ao_pyro_set(void);
 
 void
 ao_pyro_set(void);