Record average accelerometer value in flight start log record
authorKeith Packard <keithp@keithp.com>
Mon, 11 May 2009 05:54:14 +0000 (22:54 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 11 May 2009 05:54:14 +0000 (22:54 -0700)
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>
ao.h
ao_log.c

diff --git a/ao.h b/ao.h
index aa7163fc141342850d0c97b1a1e19a378ca4b7ac..4505edfab4dbd9e622ab4a036df1010c24a4c308 100644 (file)
--- 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 {
index bcd852c0bc5089780eb5fa38889575c592f11757..47d960d4e517c85507cbcbeae8cf8ac5cefc73c9 100644 (file)
--- 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 (;;) {