# HG changeset patch # User ideenmodellierer # Date 1581796258 -3600 # Node ID 514e6269256f2523de843e74b046f84f3e4bc0a6 # Parent 86fcac4cc43a6baaac2602862b250d371f27bc55 Added function to analyse the sampel ringbuffer: The function will show 0 for used sectors, 4 for the sector currently in use and 5 for empty sectors. This allows identification of log sample index position and identification of a buffer corruption (more than 2 sectors have state 4) The repair function writes dummy bytes to the end of the active buffer with the lower sector number. This decision is based on the fact that corruption results typically in a reset of index to buffer start address. After repair the writing will be continued using the hugher buffer marked as used. diff -r 86fcac4cc43a -r 514e6269256f Discovery/Src/logbook.c --- a/Discovery/Src/logbook.c Sat Feb 15 20:50:20 2020 +0100 +++ b/Discovery/Src/logbook.c Sat Feb 15 20:50:58 2020 +0100 @@ -1189,6 +1189,8 @@ } ext_flash_write_settings(); ext_flash_disable_protection_for_logbook(); + + ext_flash_CloseSector(); /* this is just a repair function which invalidates a not used sector in case a log maintenance was called before dive */ bDiveMode = 3; } if(bDiveMode == 3)