summaryrefslogtreecommitdiff
path: root/src/avr/ao_spi_slave.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-08-27 15:19:43 -0700
committerKeith Packard <keithp@keithp.com>2011-08-27 15:19:43 -0700
commitb33a92e372327158ab21c1bb2d091c58761efe10 (patch)
tree3603ca6802d59a36e090d826fc5e11a39c290982 /src/avr/ao_spi_slave.c
parent7e2b5e2957ddcb808723081ca7e046a28b7e70e5 (diff)
altos: Share log code between telescience and telebt. Add telebt log
Telescience and telebt both log data in 32-byte chunks, so share some code which manages that between the two products. Add simple telemetry logging to telebt. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/avr/ao_spi_slave.c')
-rw-r--r--src/avr/ao_spi_slave.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/avr/ao_spi_slave.c b/src/avr/ao_spi_slave.c
index 4dde09f3..e4d866a8 100644
--- a/src/avr/ao_spi_slave.c
+++ b/src/avr/ao_spi_slave.c
@@ -74,9 +74,9 @@ static uint8_t ao_spi_slave_recv(void)
return 0;
}
- ao_log_store.tm_tick = ao_companion_command.tick;
- if (ao_log_store.tm_state != ao_companion_command.flight_state) {
- ao_log_store.tm_state = ao_companion_command.flight_state;
+ ao_log_single_write_data.telescience.tm_tick = ao_companion_command.tick;
+ if (ao_log_single_write_data.telescience.tm_state != ao_companion_command.flight_state) {
+ ao_log_single_write_data.telescience.tm_state = ao_companion_command.flight_state;
return 1;
}
return 0;
@@ -93,11 +93,11 @@ ISR(PCINT0_vect)
cli();
changed = ao_spi_slave_recv();
sei();
- if (changed && ao_flight_boost <= ao_log_store.tm_state) {
- if (ao_log_store.tm_state < ao_flight_landed)
- ao_log_start();
+ if (changed && ao_flight_boost <= ao_log_single_write_data.telescience.tm_state) {
+ if (ao_log_single_write_data.telescience.tm_state < ao_flight_landed)
+ ao_log_single_start();
else
- ao_log_stop();
+ ao_log_single_stop();
}
}
} else {