- /* Write state change to EEPROM */
- if (ao_flight_state != ao_log_state) {
- ao_log_state = ao_flight_state;
- log.type = AO_LOG_STATE;
- log.tick = ao_flight_tick;
- log.u.state.state = ao_log_state;
- log.u.state.reason = 0;
- ao_log_data(&log);
-
- if (ao_log_state == ao_flight_landed)
- ao_log_stop();
- }
+ }
+ /* Write state change to EEPROM */
+ if (ao_flight_state != ao_log_state) {
+ ao_log_state = ao_flight_state;
+ log.type = AO_LOG_STATE;
+ log.tick = ao_sample_tick;
+ log.u.state.state = ao_log_state;
+ log.u.state.reason = 0;
+ ao_log_data(&log);
+
+ if (ao_log_state == ao_flight_landed)
+ ao_log_stop();