diff Discovery/Src/settings.c @ 740:5078da3845c0

Added button lock after wakeup in surface mode: During setup of diveequipment the OSTC4 is sometimes operated unintended (e.g. while equipping the jaket). To avoid this it is now possible to activate a button lock in the button lock sensitivity menu. The OSTC4 will then wakeup as usuall but if the diver wants to oerate the menus he has to press the buttons in a certain order. The button to be pressed is indicated by a blue bar. The button lock is deactivated in dive mode.
author Ideenmodellierer
date Thu, 02 Feb 2023 17:35:38 +0100
parents 7b0e020513e3
children b6d8a6fbf4fd
line wrap: on
line diff
--- a/Discovery/Src/settings.c	Thu Feb 02 17:26:54 2023 +0100
+++ b/Discovery/Src/settings.c	Thu Feb 02 17:35:38 2023 +0100
@@ -87,7 +87,7 @@
  * There might even be entries with fixed values that have no range
  */
 const SSettings SettingsStandard = {
-    .header = 0xFFFF0024,
+    .header = 0xFFFF0025,
     .warning_blink_dsec = 8 * 2,
     .lastDiveLogId = 0,
     .logFlashNextSampleStartAddress = SAMPLESTART,
@@ -330,6 +330,7 @@
 	.ext_sensor_map[2] = SENSOR_OPTIC,
 	.ext_sensor_map[3] = SENSOR_NONE,
 	.ext_sensor_map[4] = SENSOR_NONE,
+	.buttonLockActive = 0
 };
 
 /* Private function prototypes -----------------------------------------------*/
@@ -529,6 +530,8 @@
     				 pSettings->ext_sensor_map[3] = SENSOR_NONE;
     				 pSettings->ext_sensor_map[4] = SENSOR_NONE;
     	// no break;
+    case 0xFFFF0024: pSettings->buttonLockActive = 0;
+    	// no break;
     default:
         pSettings->header = pStandard->header;
         break; // no break before!!
@@ -1547,6 +1550,12 @@
        	corrections++;
     }
 
+    if(Settings.buttonLockActive > 1)
+    {
+        Settings.buttonLockActive = 1;
+        corrections++;
+    }
+
     if(corrections)
     {
     	settingsWarning = 1;