changeset 447:adc4ccbebbb5 minor_improvments

Added compile switch var firmware variant which does trust the memory log => does not check the log consistency at startu (used for test purpose)
author ideenmodellierer
date Mon, 23 Mar 2020 21:10:02 +0100
parents f1257a32f2d4
children f7c66593ab82
files Discovery/Src/base.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/base.c	Thu Mar 05 22:31:50 2020 +0100
+++ b/Discovery/Src/base.c	Mon Mar 23 21:10:02 2020 +0100
@@ -435,9 +435,16 @@
     GFX_logoAutoOff();
     EXTILine_Buttons_Config();
 
+#ifdef TRUST_LOG_CONSISTENCY
+    if(!ext_dive_log_consistent())	/* only repair log if an invalid entry was detected */
+    {
+    	ext_flash_repair_dive_log();
+    }
+
+#else	/* always check and repair log */
     ext_flash_repair_dive_log();
     //ext_flash_repair_SPECIAL_dive_numbers_starting_count_with(1);
-
+#endif
     totalDiveCounterFound = logbook_lastDive_diveNumber();
     if( settingsGetPointer()->totalDiveCounter < totalDiveCounterFound )
             settingsGetPointer()->totalDiveCounter = totalDiveCounterFound;