diff Common/Inc/settings.h @ 788:4abfb8a2a435

Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
author heinrichsweikamp
date Tue, 04 Jul 2023 14:39:06 +0200
parents 45b8f3c2acce
children 75ace7af8212
line wrap: on
line diff
--- a/Common/Inc/settings.h	Sun Jun 04 21:59:26 2023 +0200
+++ b/Common/Inc/settings.h	Tue Jul 04 14:39:06 2023 +0200
@@ -27,6 +27,9 @@
 #ifndef SETTINGS_H
 #define SETTINGS_H
 
+#include <stdint.h>
+#include <stdbool.h>
+
 // From Common/Inc:
 #include "FirmwareData.h"
 
@@ -39,8 +42,6 @@
 
 #include "configuration.h"
 
-#include <stdint.h>
-
 
 #define NUM_GASES 5
 #define NUM_OFFSET_DILUENT 5
@@ -86,7 +87,7 @@
 
 #define UART_MAX_PROTOCOL		(2u)
 
-#define FUTURE_SPARE_SIZE		(3u)		/* Applied for reuse of old, not used, scooter block (was 32 bytes)*/
+#define FUTURE_SPARE_SIZE		(2u)		/* Applied for reuse of old, not used, scooter block (was 32 bytes)*/
 
 typedef enum
 {
@@ -168,6 +169,13 @@
 	RTC_DateTypeDef lastDive;
 } SScrubberData;
 
+enum {
+    SETPOINT_INDEX_CUSTOM = 0,
+    SETPOINT_INDEX_AUTO_LOW,
+    SETPOINT_INDEX_AUTO_HIGH,
+    SETPOINT_INDEX_AUTO_DECO,
+};
+
 
 /* SSettings
 	 * gas[0] and setpoint[0] are the special ones configurable during the dive
@@ -237,7 +245,8 @@
 	SScrubberData scrubberData[2];
 	uint8_t ext_sensor_map[5];
 	uint8_t buttonLockActive;										/* redefined in 0xFFFF0025 */
-	int8_t compassDeclinationDeg;										/* redefined in 0xFFFF0026 */
+	int8_t compassDeclinationDeg;
+    uint8_t delaySetpointLow;                                         /* redefined in 0xFFFF0026 */
 	uint8_t Future_SPARE[FUTURE_SPARE_SIZE];					/* redefined in 0xFFFF0020 (old scooter Block was 32 byte)*/
 	// new in 0xFFFF0006
 	uint8_t ppo2sensors_deactivated;
@@ -373,4 +382,5 @@
 void reset_SettingWarning();
 uint8_t isSettingsWarning();
 
+bool checkAndFixSetpointSettings(void);
 #endif // SETTINGS_H