diff Discovery/Src/externLogbookFlash.c @ 441:9a9e4908ce2e

fix potential issue with >255 dives in the logbook
author heinrichsweikamp
date Sun, 01 Mar 2020 10:06:45 +0100
parents 7f351c25608a
children 2effe85f1a9b
line wrap: on
line diff
--- a/Discovery/Src/externLogbookFlash.c	Thu Feb 27 09:13:25 2020 +0100
+++ b/Discovery/Src/externLogbookFlash.c	Sun Mar 01 10:06:45 2020 +0100
@@ -1407,7 +1407,7 @@
   /* TODO Cleanup_Ref_1: cleanup logFlashNextSampleStartAddress and lastDiveLogId */
   /* The implementation below would cause problems in case more then 254 dives would be done. */
   /* This is avoided by Cleanup_Ref2 */
-  for(id = 0; id < 255;id++)
+  for(id = 0; id <= 255;id++)
   {
     actualAddress = HEADERSTART + (0x800 * id) + HEADER2OFFSET;
     ext_flash_read_block_start();