summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-05-10 22:54:14 -0700
committerKeith Packard <keithp@keithp.com>2009-05-10 22:54:14 -0700
commit98806b1ff3f41484663d61ff430e9e2764c7b5e6 (patch)
treeeb62f4f7ad9327adcd415c5681821f8d31708ba2
parenta12edbfe21fe27a9efbf87bacda9ab4806256e2b (diff)
Record average accelerometer value in flight start log record
The average accelerometer value cannot be extracted from the log as the record starts after that is computed. As that drives much of the accelerometer-based state transition logic, it is an important value to have, so we log it as part of the flight start record now. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--ao.h2
-rw-r--r--ao_log.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/ao.h b/ao.h
index aa7163fc..4505edfa 100644
--- a/ao.h
+++ b/ao.h
@@ -467,7 +467,7 @@ struct ao_log_record {
uint16_t tick;
union {
struct {
- uint16_t serial;
+ int16_t ground_accel;
uint16_t flight;
} flight;
struct {
diff --git a/ao_log.c b/ao_log.c
index bcd852c0..47d960d4 100644
--- a/ao_log.c
+++ b/ao_log.c
@@ -121,7 +121,7 @@ ao_log(void)
log.type = AO_LOG_FLIGHT;
log.tick = ao_flight_tick;
- log.u.flight.serial = 0;
+ log.u.flight.ground_accel = ao_ground_accel;
log.u.flight.flight = ao_log_dump_flight + 1;
ao_log_data(&log);
for (;;) {