changeset 426:514e6269256f ImprovmentNVM_2

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.
author ideenmodellierer
date Sat, 15 Feb 2020 20:50:58 +0100
parents 86fcac4cc43a
children b1091e183d52
files Discovery/Src/logbook.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)