diff options
author | Keith Packard <keithp@keithp.com> | 2011-08-12 21:34:37 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-08-12 21:34:37 -0700 |
commit | 91785e03363f328b644f2c03b5438235f3a44c3e (patch) | |
tree | 5bc5bae478adef6df08898ed9da7cd44fe56f43f /src-avr/ao.h | |
parent | b3ba69f3eda0d07d7f2fc0922556a011c95d7951 (diff) |
altos-avr: Store TM tick and state in log, get logging on/off working
To sync TM and TS data after flight, store the TM tick data in the log
along with the TM state. This should provide sufficient data to
synchronize the two data streams.
Use the TM state to enable/disable logging, log from boost to landing
and otherwise do not log.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src-avr/ao.h')
-rw-r--r-- | src-avr/ao.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src-avr/ao.h b/src-avr/ao.h index fb3612d4..9ff9dc25 100644 --- a/src-avr/ao.h +++ b/src-avr/ao.h @@ -577,12 +577,31 @@ extern __pdata uint32_t ao_log_start_pos; extern __xdata uint8_t ao_log_running; extern __xdata enum flight_state ao_log_state; +#define AO_LOG_TELESCIENCE_START ((uint8_t) 's') +#define AO_LOG_TELESCIENCE_DATA ((uint8_t) 'd') + +struct ao_log_telescience { + uint8_t type; + uint8_t csum; + uint16_t tick; + uint16_t tm_tick; + uint8_t tm_state; + uint8_t unused; + uint16_t adc[NUM_ADC]; +}; + +extern struct ao_log_telescience ao_log_store; + /* required functions from the underlying log system */ /* Return the flight number from the given log slot, 0 if none */ uint16_t ao_log_flight(uint8_t slot); +/* Flash has been erased, go find the start of storage */ +void +ao_log_restart(void); + /* Flush the log */ void ao_log_flush(void); @@ -1440,6 +1459,7 @@ ao_spi_slave_init(void); #define AO_COMPANION_SETUP 1 #define AO_COMPANION_FETCH 2 +#define AO_COMPANION_STATE 3 struct ao_companion_command { uint8_t command; |