From 62547a042d042fadec652c5081f96816a8e66970 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 26 May 2013 19:03:12 -0600 Subject: [PATCH] altos,altosui: Add pyro state logging for TeleMega 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 --- altoslib/AltosEepromMega.java | 1 + src/core/ao_log.h | 3 ++- src/core/ao_log_mega.c | 1 + src/core/ao_pyro.c | 2 ++ src/core/ao_pyro.h | 2 ++ 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/altoslib/AltosEepromMega.java b/altoslib/AltosEepromMega.java index b077e26c..0804c392 100644 --- a/altoslib/AltosEepromMega.java +++ b/altoslib/AltosEepromMega.java @@ -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 pyro() { return data16(26); } /* AO_LOG_GPS_TIME elements */ public int latitude() { return data32(0); } diff --git a/src/core/ao_log.h b/src/core/ao_log.h index e1461a14..dce12f02 100644 --- a/src/core/ao_log.h +++ b/src/core/ao_log.h @@ -236,7 +236,8 @@ struct ao_log_mega { 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 */ diff --git a/src/core/ao_log_mega.c b/src/core/ao_log_mega.c index abf953a6..0db1119c 100644 --- a/src/core/ao_log_mega.c +++ b/src/core/ao_log_mega.c @@ -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.pyro = ao_pyro_fired; ao_log_mega(&log); next_other = log.tick + AO_OTHER_INTERVAL; } diff --git a/src/core/ao_pyro.c b/src/core/ao_pyro.c index b655eaca..b3cda656 100644 --- a/src/core/ao_pyro.c +++ b/src/core/ao_pyro.c @@ -33,6 +33,8 @@ #define ao_lowbit(x) ((x) & (-x)) +uint16_t ao_pyro_fired; + /* * Given a pyro structure, figure out * if the current flight state satisfies all diff --git a/src/core/ao_pyro.h b/src/core/ao_pyro.h index cde850ad..1f838542 100644 --- a/src/core/ao_pyro.h +++ b/src/core/ao_pyro.h @@ -63,6 +63,8 @@ struct ao_pyro { extern uint8_t ao_pyro_wakeup; +extern uint16_t ao_pyro_fired; + void ao_pyro_set(void); -- 2.30.2