diff Discovery/Src/tMenu.c @ 816:c4ee952b9425

Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
author heinrichsweikamp
date Sun, 10 Sep 2023 11:46:45 +0200
parents ce8f71217f45
children 2a9a47547b05
line wrap: on
line diff
--- a/Discovery/Src/tMenu.c	Sun Sep 03 18:03:49 2023 +0200
+++ b/Discovery/Src/tMenu.c	Sun Sep 10 11:46:45 2023 +0200
@@ -129,6 +129,14 @@
 }
 
 
+void clearDisabledMenuLines(void)
+{
+    for(unsigned i = 0; i <= MAXPAGES; i++) {
+        menu.disableLineMask[i] = 0;
+    }
+}
+
+
 void tM_init(void)
 {
     uint8_t i;
@@ -154,9 +162,10 @@
         menu.StartAddressForPage[i] = 0;
         menu.linesAvailableForPage[i] = 0;
         menu.shadowPage[i] = 0;
-        menu.disableLineMask[i] = 0;
     }
 
+    clearDisabledMenuLines();
+
     tMscreen.FBStartAdress = 0;
     tMscreen.ImageHeight = 480;
     tMscreen.ImageWidth = 800;