comparison Common/Inc/settings.h @ 710:8adf9b8fc7fa

Extension scrubber time: In previous version only one scrubber timer was available. After movement of scruvver timer menu menu space became available allowing to upgrade the functionality to support two scrubbers. To make it easier to identify combination ID to used scrubber the date of the last usage of the scrubber timer has been added.
author Ideenmodellierer
date Tue, 08 Nov 2022 21:16:17 +0100
parents 6d7c812fc173
children 34eb693720eb
comparison
equal deleted inserted replaced
709:c799151670d5 710:8adf9b8fc7fa
33 //#include "data_central.h" 33 //#include "data_central.h"
34 34
35 #include "global_constants.h" 35 #include "global_constants.h"
36 // From Common/Drivers/ 36 // From Common/Drivers/
37 #include "stm32f4xx_hal.h" 37 #include "stm32f4xx_hal.h"
38 #include "stm32f4xx_hal_rtc.h"
38 39
39 #include "configuration.h" 40 #include "configuration.h"
40 41
41 #include <stdint.h> 42 #include <stdint.h>
42 43
82 #define PSCR_MIN_LUNG_RATIO (5u) 83 #define PSCR_MIN_LUNG_RATIO (5u)
83 #define PSCR_MAX_LUNG_RATIO (20u) 84 #define PSCR_MAX_LUNG_RATIO (20u)
84 85
85 #define UART_MAX_PROTOCOL (2u) 86 #define UART_MAX_PROTOCOL (2u)
86 87
87 #define FUTURE_SPARE_SIZE (28u) /* Applied for reuse of old, not used, scooter block (was 32 bytes)*/ 88 #define FUTURE_SPARE_SIZE (11u) /* Applied for reuse of old, not used, scooter block (was 32 bytes)*/
88 89
89 typedef enum 90 typedef enum
90 { 91 {
91 O2_SENSOR_SOURCE_OPTIC = 0, 92 O2_SENSOR_SOURCE_OPTIC = 0,
92 O2_SENSOR_SOURCE_ANALOG, 93 O2_SENSOR_SOURCE_ANALOG,
156 uint8_t setpoint_cbar; 157 uint8_t setpoint_cbar;
157 uint8_t depth_meter; 158 uint8_t depth_meter;
158 gasbit8_Type note; 159 gasbit8_Type note;
159 } SSetpointLine; 160 } SSetpointLine;
160 161
162
163 typedef struct
164 {
165 uint16_t TimerMax;
166 uint16_t TimerCur;
167 RTC_DateTypeDef lastDive;
168 } SScrubberData;
161 169
162 170
163 /* SSettings 171 /* SSettings
164 * gas[0] and setpoint[0] are the special ones configurable during the dive 172 * gas[0] and setpoint[0] are the special ones configurable during the dive
165 */ 173 */
221 uint32_t updateSettingsAllowedFromHeader; 229 uint32_t updateSettingsAllowedFromHeader;
222 uint8_t pscr_lung_ratio; /* redefined in 0xFFFF0020 */ 230 uint8_t pscr_lung_ratio; /* redefined in 0xFFFF0020 */
223 uint8_t pscr_o2_drop; /* redefined in 0xFFFF0020 */ 231 uint8_t pscr_o2_drop; /* redefined in 0xFFFF0020 */
224 uint8_t co2_sensor_active; /* redefined in 0xFFFF0021 */ 232 uint8_t co2_sensor_active; /* redefined in 0xFFFF0021 */
225 uint8_t ext_uart_protocol; /* redefined in 0xFFFF0022 */ 233 uint8_t ext_uart_protocol; /* redefined in 0xFFFF0022 */
234
235 uint8_t scubberActiveId; /* redefined in 0xFFFF0023 */
236 SScrubberData scrubberData[2];
237
226 uint8_t Future_SPARE[FUTURE_SPARE_SIZE]; /* redefined in 0xFFFF0020 (old scooter Block was 32 byte)*/ 238 uint8_t Future_SPARE[FUTURE_SPARE_SIZE]; /* redefined in 0xFFFF0020 (old scooter Block was 32 byte)*/
227 // new in 0xFFFF0006 239 // new in 0xFFFF0006
228 uint8_t ppo2sensors_deactivated; 240 uint8_t ppo2sensors_deactivated;
229 uint8_t tX_colorscheme; 241 uint8_t tX_colorscheme;
230 uint8_t tX_userselectedLeftLowerCornerPrimary; 242 uint8_t tX_userselectedLeftLowerCornerPrimary;
274 uint8_t ppo2sensors_source; 286 uint8_t ppo2sensors_source;
275 float ppo2sensors_calibCoeff[3]; 287 float ppo2sensors_calibCoeff[3];
276 uint8_t amPMTime; 288 uint8_t amPMTime;
277 /* new in 0xFFFF001F */ 289 /* new in 0xFFFF001F */
278 uint8_t autoSetpoint; 290 uint8_t autoSetpoint;
279 uint16_t scrubTimerMax; 291 uint16_t scrubTimerMax_Obsolete; /* have been replaced with new scrubber data format */
280 uint16_t scrubTimerCur; 292 uint16_t scrubTimerCur_Obsolete; /* have been replaced with new scrubber data format */
281 uint8_t scrubTimerMode; 293 uint8_t scrubTimerMode;
282 } SSettings; 294 } SSettings;
283 295
284 typedef struct 296 typedef struct
285 { 297 {