diff Discovery/Src/settings.c @ 807:9e2ebfc72e8c

Zusammenf?hren
author heinrichsweikamp
date Sat, 26 Aug 2023 13:37:06 +0200
parents ee3c0029ed34 dd7ce655db26
children 40e951cfa443
line wrap: on
line diff
--- a/Discovery/Src/settings.c	Sat Aug 26 13:35:15 2023 +0200
+++ b/Discovery/Src/settings.c	Sat Aug 26 13:37:06 2023 +0200
@@ -337,6 +337,7 @@
 	.buttonLockActive = 0,
     .compassDeclinationDeg = 0,
     .delaySetpointLow = false,
+    .timerDurationS = 180,
 };
 
 /* Private function prototypes -----------------------------------------------*/
@@ -544,6 +545,9 @@
         // Disable auto setpoint to avoid a configuration warning being triggered by the new auto setpoint validation
         // This ensures that users don't lose setpoint information if it is not in the right spot for the new configuration
         pSettings->autoSetpoint = false;
+
+        pSettings->timerDurationS = pStandard->timerDurationS;
+
     	// no break;
     case 0xFFFF0026:
     	pSettings->ext_sensor_map[0] = pSettings->ext_sensor_map_Obsolete[0];
@@ -554,7 +558,8 @@
     	pSettings->ext_sensor_map[5] = SENSOR_NONE;
     	pSettings->ext_sensor_map[6] = SENSOR_NONE;
     	pSettings->ext_sensor_map[7] = SENSOR_NONE;
-    	// no break;
+
+        // no break;
     default:
         pSettings->header = pStandard->header;
         break; // no break before!!
@@ -1621,6 +1626,16 @@
         corrections++;
     }
 
+    if (Settings.timerDurationS > 599) {
+        Settings.timerDurationS = 599;
+
+        corrections++;
+    } else if (Settings.timerDurationS < 1) {
+        Settings.timerDurationS = 1;
+
+        corrections++;
+    }
+
     if(corrections)
     {
     	settingsWarning = 1;