comparison Common/Inc/settings.h @ 1014:8c0134a287da GasConsumption

Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes) is decremented. The event contains a 12 bit signed integer for the remaining scrubber duration, and two flags for scrubber warning (0x2000, <= 30 minutes remaining) and scrubber error (0x4000, <= 0 minutes remaining). (mikeller)
author heinrichsweikamp
date Sun, 11 May 2025 16:18:20 +0200
parents df052f0347fb
children 5924a2d1d3ba
comparison
equal deleted inserted replaced
1013:fa1af49319e5 1014:8c0134a287da
79 79
80 #define MAX_COMPASS_DECLINATION_DEG 99 80 #define MAX_COMPASS_DECLINATION_DEG 99
81 81
82 #define MAX_VIEWPORT_MODE (0x7F) 82 #define MAX_VIEWPORT_MODE (0x7F)
83 83
84 #define MAX_SCRUBBER_TIME (999u) 84 #define MAX_SCRUBBER_TIME (999u)
85 #define MIN_SCRUBBER_TIME -99 85 #define MIN_SCRUBBER_TIME -99
86 #define SCRUBBER_WARNING_TIME 30
87 #define SCRUBBER_ERROR_TIME 0
88
86 #define MIN_PPO2_SP_CBAR (40u) 89 #define MIN_PPO2_SP_CBAR (40u)
87 90
88 #define PSCR_MAX_O2_DROP (15u) 91 #define PSCR_MAX_O2_DROP (15u)
89 #define PSCR_MIN_LUNG_RATIO (5u) 92 #define PSCR_MIN_LUNG_RATIO (5u)
90 #define PSCR_MAX_LUNG_RATIO (20u) 93 #define PSCR_MAX_LUNG_RATIO (20u)
106 } SensorSource; 109 } SensorSource;
107 #define MAX_O2_SENSOR_SOURCE (2u) 110 #define MAX_O2_SENSOR_SOURCE (2u)
108 111
109 typedef enum 112 typedef enum
110 { 113 {
111 SCRUB_TIMER_OFF = 0, 114 INVALID_SCRUB_TIMER_OFF = 0,
112 SCRUB_TIMER_MINUTES, 115 SCRUB_TIMER_MINUTES,
113 SCRUB_TIMER_PERCENT, 116 SCRUB_TIMER_PERCENT,
114 SCRUB_TIMER_END 117 SCRUB_TIMER_END
115 } ScrubTimerMode_e; 118 } ScrubTimerMode_e;
116 119
256 uint8_t pscr_lung_ratio; /* redefined in 0xFFFF0020 */ 259 uint8_t pscr_lung_ratio; /* redefined in 0xFFFF0020 */
257 uint8_t pscr_o2_drop; /* redefined in 0xFFFF0020 */ 260 uint8_t pscr_o2_drop; /* redefined in 0xFFFF0020 */
258 uint8_t co2_sensor_active; /* redefined in 0xFFFF0021 */ 261 uint8_t co2_sensor_active; /* redefined in 0xFFFF0021 */
259 uint8_t ext_uart_protocol; /* redefined in 0xFFFF0022 */ 262 uint8_t ext_uart_protocol; /* redefined in 0xFFFF0022 */
260 263
261 uint8_t scubberActiveId; /* redefined in 0xFFFF0023 */ 264 uint8_t scrubberActiveId; /* redefined in 0xFFFF0023 */
262 SScrubberData scrubberData[2]; 265 SScrubberData scrubberData[2];
263 uint8_t ext_sensor_map_Obsolete[5]; 266 uint8_t ext_sensor_map_Obsolete[5];
264 uint8_t buttonLockActive; /* redefined in 0xFFFF0025 */ 267 uint8_t buttonLockActive; /* redefined in 0xFFFF0025 */
265 int8_t compassDeclinationDeg; 268 int8_t compassDeclinationDeg;
266 uint8_t delaySetpointLow; 269 uint8_t delaySetpointLow;
407 void get_CorrectionStatus(SSettingsStatus* Status); 410 void get_CorrectionStatus(SSettingsStatus* Status);
408 void reset_SettingWarning(); 411 void reset_SettingWarning();
409 uint8_t isSettingsWarning(); 412 uint8_t isSettingsWarning();
410 413
411 bool checkAndFixSetpointSettings(void); 414 bool checkAndFixSetpointSettings(void);
415
416 bool isScrubberWarning(const SScrubberData *scrubberData);
417 bool isScrubberError(const SScrubberData *scrubberData);
412 #endif // SETTINGS_H 418 #endif // SETTINGS_H