The very first record in the eeprom is the flight number, but it is
time-stamped with the 'boost' time, and so it gets sorted until much
later, delaying the return of data until the rocket enters boost
mode. This drops all of the nice pad GPS and state date on the floor.
Signed-off-by: Keith Packard <keithp@keithp.com>
state.tick = record.tick;
switch (record.cmd) {
case Altos.AO_LOG_FLIGHT:
- state.ground_accel = record.a;
- state.flight = record.b;
- seen |= seen_flight;
+ /* recorded when first read from the file */
break;
case Altos.AO_LOG_SENSOR:
state.accel = record.a;
saw_boost = true;
boost_tick = tick;
}
+ if (record.cmd == Altos.AO_LOG_FLIGHT) {
+ state.ground_accel = record.a;
+ state.flight = record.b;
+ seen |= seen_flight;
+ }
/* Two firmware bugs caused the loss of some GPS data.
* The flight date would never be recorded, and often