recording_started: u32,
+ // The total distance logged of the currently running recording.
+ pub total_distance_cm: u32,
+
// The number of slots filled in num_flight.
num_in_flight: usize,
recording_id: 0,
first_sector: 0,
recording_started: 0,
+ total_distance_cm: 0,
num_in_flight: 0,
in_flight: [InFlight::new(); 7],
self.sectors_written = 0;
self.recording_started = tap.unix_time;
+ self.total_distance_cm = 0;
self.num_in_flight = 0;
self.prepare_write_buffer(true);
}
pub fn log(&mut self, prev_tap: &TimeAndPos, tap: &TimeAndPos) {
+ self.total_distance_cm += tap.distance_cm(&prev_tap) as u32;
+
let d_time_ms = elapsed_ms(tap.system_time, prev_tap.system_time);
// We know that our hardware cannot deliver updates more often