diff Discovery/Src/settings.c @ 650:5f0d3dce5ef4

Automatik setpoint change: In previous versions a better set point was suggested by the OSTC but had to be confirmed using the quick menu functionality. To improve usability an option has been added to the setpoint menu which allows the selection of automatically setpoint changes. If activated the OSTC will automatically switch to the setpoint in case the matching depth is passed.
author Ideenmodellierer
date Mon, 19 Apr 2021 20:19:32 +0200
parents ebe3fc302ab8
children f6212495f34f
line wrap: on
line diff
--- a/Discovery/Src/settings.c	Mon Apr 19 20:16:24 2021 +0200
+++ b/Discovery/Src/settings.c	Mon Apr 19 20:19:32 2021 +0200
@@ -85,7 +85,7 @@
  * There might even be entries with fixed values that have no range
  */
 const SSettings SettingsStandard = {
-    .header = 0xFFFF001E,
+    .header = 0xFFFF001F,
     .warning_blink_dsec = 8 * 2,
     .lastDiveLogId = 0,
     .logFlashNextSampleStartAddress = 0,
@@ -323,6 +323,9 @@
 	.ppo2sensors_calibCoeff[1] = 0.0,
 	.ppo2sensors_calibCoeff[2] = 0.0,
 	.amPMTime = 0,
+	.autoSetpoint = 0,
+	.scrubTimerMax = 0,
+	.scrubTimerCur = 0,
 };
 
 /* Private function prototypes -----------------------------------------------*/
@@ -1439,6 +1442,20 @@
     	Settings.amPMTime = 0;
     	corrections++;
     }
+
+    if(Settings.autoSetpoint > 1) /* only boolean values allowed */
+    {
+    	Settings.autoSetpoint = 0;
+    	corrections++;
+    }
+
+    if((Settings.scrubTimerMax > MAX_SCRUBBER_TIME) || (Settings.scrubTimerCur > MAX_SCRUBBER_TIME))
+    {
+    	Settings.scrubTimerMax = 0;
+    	Settings.scrubTimerCur = 0;
+    	corrections++;
+    }
+
     if(corrections > 255)
         return 255;
     else