From: Tilman Sauerbeck Date: Thu, 9 Jan 2020 10:02:21 +0000 (+0100) Subject: common: Synchronize sector headers after a recording is finished. X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=9c56bca3b719a7e44074225a99d9f97fd05466d3;p=gps-watch.git common: Synchronize sector headers after a recording is finished. This is necessary to be able to retrieve the recording without restarting the device. --- diff --git a/src/common/logger.rs b/src/common/logger.rs index d958193..d83d239 100644 --- a/src/common/logger.rs +++ b/src/common/logger.rs @@ -421,7 +421,13 @@ impl<'a> Logger<'a> { self.storage.write(this_sector as usize * SECTOR_SIZE, &self.write_buffer); - self.sectors_written + 1 + self.sectors_written += 1; + + for i in 0..self.sectors_written { + self.read_sector_header((self.first_sector + i) as usize); + } + + self.sectors_written } fn sector_header_iter(&self) -> SectorHeaderIter {