Mercurial > public > ostc4
annotate Common/Inc/settings.h @ 976:0b81ac558e89 Evo_2_23
Devbugfix UART buffer cleaning:
In the previous version a buffer cleaning function was used which resets the ringbuffer read index. As result the processing of data was stopped until the DMA write comes to the index 0. When reaching it the complete buffer was proceeded including possibly invalid data.
The usage of the cleanbuffer function was replaced by the flush buffer function (meaning the data is discarded but the data index is maintained). There was already a function for this. Because the function was 99% the same as the read function, it was integrated into the ReadData function. Calling the function with parameter flush = 1 will result in a buffer flush.
The workaround of the previous revision was updated to only be applied in case a DiveO2 sensor is operated in stand alone mode.
author | Ideenmodellierer |
---|---|
date | Wed, 29 Jan 2025 17:21:20 +0100 (3 months ago) |
parents | 79b522fbabe6 |
children | 22d5b477c903 |
rev | line source |
---|---|
38 | 1 /////////////////////////////////////////////////////////////////////////////// |
2 /// -*- coding: UTF-8 -*- | |
3 /// | |
4 /// \file Common/Inc/settings.h | |
5 /// \brief | |
6 /// \author Heinrichs Weikamp | |
7 /// \date 2018 | |
8 /// | |
9 /// $Id$ | |
10 /////////////////////////////////////////////////////////////////////////////// | |
11 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
12 /// | |
13 /// This program is free software: you can redistribute it and/or modify | |
14 /// it under the terms of the GNU General Public License as published by | |
15 /// the Free Software Foundation, either version 3 of the License, or | |
16 /// (at your option) any later version. | |
17 /// | |
18 /// This program is distributed in the hope that it will be useful, | |
19 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 /// GNU General Public License for more details. | |
22 /// | |
23 /// You should have received a copy of the GNU General Public License | |
24 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
25 ////////////////////////////////////////////////////////////////////////////// | |
26 | |
27 #ifndef SETTINGS_H | |
28 #define SETTINGS_H | |
29 | |
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)
heinrichsweikamp
parents:
776
diff
changeset
|
30 #include <stdint.h> |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
776
diff
changeset
|
31 #include <stdbool.h> |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
776
diff
changeset
|
32 |
38 | 33 // From Common/Inc: |
34 #include "FirmwareData.h" | |
35 | |
36 //#include "data_central.h" | |
37 | |
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
38
diff
changeset
|
38 #include "global_constants.h" |
38 | 39 // From Common/Drivers/ |
40 #include "stm32f4xx_hal.h" | |
710 | 41 #include "stm32f4xx_hal_rtc.h" |
38 | 42 |
691 | 43 #include "configuration.h" |
44 | |
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
38
diff
changeset
|
45 |
38 | 46 #define NUM_GASES 5 |
47 #define NUM_OFFSET_DILUENT 5 | |
48 #define SPECIAL_GAS_ID 0 | |
864
fa431d42b5fb
Fix incorrect logging of bailout to Open Circuit when using the best gas.
heinrichsweikamp
parents:
819
diff
changeset
|
49 #define NO_GAS_ID 255 |
38 | 50 |
51 #define ERROR_ 0xFF | |
52 | |
53 #define CCRMODE_FixedSetpoint 0 | |
54 #define CCRMODE_Sensors 1 | |
662 | 55 #define CCRMODE_Simulation 2 |
38 | 56 |
57 #define DIVEMODE_OC 0 | |
58 #define DIVEMODE_CCR 1 | |
59 #define DIVEMODE_Gauge 2 | |
60 #define DIVEMODE_Apnea 3 | |
662 | 61 #define DIVEMODE_PSCR 4 |
38 | 62 |
63 #define GF_MODE 1 | |
64 #define VPM_MODE 2 | |
65 | |
66 #define VPM_FROM_FORTRAN 0 | |
67 #define VPM_BACHELORWORK 1 | |
68 | |
69 #define BUEHLMANN_OSTC4 0 | |
70 #define BUEHLMANN_hwOS 1 | |
71 | |
72 #define MMDDYY 0 | |
73 #define DDMMYY 1 | |
74 #define YYMMDD 2 | |
75 | |
337
38367bb982b8
Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents:
210
diff
changeset
|
76 #define PRESSURE_OFFSET_LIMIT_MBAR 50 |
38367bb982b8
Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents:
210
diff
changeset
|
77 |
560
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
78 #define MAX_COMPASS_COMP (2u) |
640 | 79 #define MAX_VIEWPORT_MODE (0x7F) |
560
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
80 |
676 | 81 #define MAX_SCRUBBER_TIME (999u) |
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
741
diff
changeset
|
82 #define MIN_SCRUBBER_TIME -99 |
652 | 83 #define MIN_PPO2_SP_CBAR (40u) |
650 | 84 |
662 | 85 #define PSCR_MAX_O2_DROP (15u) |
86 #define PSCR_MIN_LUNG_RATIO (5u) | |
87 #define PSCR_MAX_LUNG_RATIO (20u) | |
88 | |
691 | 89 #define UART_MAX_PROTOCOL (2u) |
90 | |
805
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
796
diff
changeset
|
91 #define FUTURE_SPARE_SIZE (0u) /* Applied for reuse of old, not used, scooter block (was 32 bytes)*/ |
662 | 92 |
560
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
93 typedef enum |
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
94 { |
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
95 O2_SENSOR_SOURCE_OPTIC = 0, |
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
96 O2_SENSOR_SOURCE_ANALOG, |
702
6d7c812fc173
Added digital o2 sensor to settings and data exchange:
Ideenmodellierer
parents:
691
diff
changeset
|
97 O2_SENSOR_SOURCE_DIGITAL, |
6d7c812fc173
Added digital o2 sensor to settings and data exchange:
Ideenmodellierer
parents:
691
diff
changeset
|
98 O2_SENSOR_SOURCE_ANADIG, |
691 | 99 #ifdef ENABLE_SENTINEL_MODE |
100 O2_SENSOR_SOURCE_SENTINEL, | |
101 #endif | |
560
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
102 O2_SENSOR_SOURCE_MAX |
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
103 } SensorSource; |
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
104 #define MAX_O2_SENSOR_SOURCE (2u) |
546 | 105 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
652
diff
changeset
|
106 typedef enum |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
652
diff
changeset
|
107 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
652
diff
changeset
|
108 SCRUB_TIMER_OFF = 0, |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
652
diff
changeset
|
109 SCRUB_TIMER_MINUTES, |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
652
diff
changeset
|
110 SCRUB_TIMER_PERCENT, |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
652
diff
changeset
|
111 SCRUB_TIMER_END |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
652
diff
changeset
|
112 } ScrubTimerMode_e; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
652
diff
changeset
|
113 |
38 | 114 /* 2015 Jan 30, hw, deco and travel added for MenuEditGas |
115 * can be used for buehlmann, vpm, etc. later but be carefull | |
116 * with current implemenation */ | |
117 typedef struct{ | |
118 uint8_t active:1; | |
119 uint8_t first:1; | |
120 uint8_t deco:1; | |
121 uint8_t travel:1; | |
526
88c626d01ee5
Added new option to gas configuration: "Off":
Ideenmodellierer
parents:
505
diff
changeset
|
122 uint8_t off:1; |
973 | 123 #ifdef ENABLE_DECOCALC_OPTION |
830
b7d93ff6b3b2
Added selection if an active gas shall be used for deco calculation or not:
Ideenmodellierer
parents:
819
diff
changeset
|
124 uint8_t decocalc:1; |
973 | 125 #endif |
830
b7d93ff6b3b2
Added selection if an active gas shall be used for deco calculation or not:
Ideenmodellierer
parents:
819
diff
changeset
|
126 uint8_t spare:2; |
38 | 127 } gasubit8_t; |
128 | |
129 typedef union{ | |
130 gasubit8_t ub; | |
131 uint8_t uw; | |
132 } gasbit8_Type; | |
133 | |
134 typedef struct{ | |
135 uint8_t standard:4; | |
136 uint8_t alternative:4; | |
137 } ubit2x4_t; | |
138 | |
139 typedef union{ | |
140 ubit2x4_t ub; | |
141 uint8_t uw; | |
142 } split2x4_Type; | |
143 | |
144 typedef union{ | |
145 uint8_t u8[4]; | |
146 uint32_t u32; | |
147 } general32to8_Type; | |
148 | |
149 typedef struct | |
150 { | |
151 uint8_t oxygen_percentage; | |
152 uint8_t helium_percentage; | |
153 gasbit8_Type note; | |
154 uint8_t depth_meter; | |
155 uint8_t depth_meter_travel; | |
156 uint8_t bottle_size_liter; | |
157 // uint8_t bottle_wireless_status; | |
158 uint16_t bottle_wireless_id; | |
159 } SGasLine; | |
160 | |
161 typedef struct | |
162 { | |
163 uint8_t setpoint_cbar; | |
164 uint8_t depth_meter; | |
165 gasbit8_Type note; | |
166 } SSetpointLine; | |
167 | |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
652
diff
changeset
|
168 |
710 | 169 typedef struct |
170 { | |
171 uint16_t TimerMax; | |
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
741
diff
changeset
|
172 int16_t TimerCur; |
710 | 173 RTC_DateTypeDef lastDive; |
174 } SScrubberData; | |
175 | |
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)
heinrichsweikamp
parents:
776
diff
changeset
|
176 enum { |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
776
diff
changeset
|
177 SETPOINT_INDEX_CUSTOM = 0, |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
776
diff
changeset
|
178 SETPOINT_INDEX_AUTO_LOW, |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
776
diff
changeset
|
179 SETPOINT_INDEX_AUTO_HIGH, |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
776
diff
changeset
|
180 SETPOINT_INDEX_AUTO_DECO, |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
776
diff
changeset
|
181 }; |
4abfb8a2a435
Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents:
776
diff
changeset
|
182 |
819
24b39a432bc2
Added debug information in case an error in the settings has been detected:
Ideenmodellierer
parents:
805
diff
changeset
|
183 typedef struct |
24b39a432bc2
Added debug information in case an error in the settings has been detected:
Ideenmodellierer
parents:
805
diff
changeset
|
184 { |
24b39a432bc2
Added debug information in case an error in the settings has been detected:
Ideenmodellierer
parents:
805
diff
changeset
|
185 uint8_t FirstCorrection; |
24b39a432bc2
Added debug information in case an error in the settings has been detected:
Ideenmodellierer
parents:
805
diff
changeset
|
186 uint8_t Corrections; |
24b39a432bc2
Added debug information in case an error in the settings has been detected:
Ideenmodellierer
parents:
805
diff
changeset
|
187 } SSettingsStatus; |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
652
diff
changeset
|
188 |
949 | 189 |
190 typedef struct | |
191 { | |
192 int8_t hours; | |
193 uint8_t minutes; | |
194 } StimeZone; | |
195 | |
196 | |
38 | 197 /* SSettings |
198 * gas[0] and setpoint[0] are the special ones configurable during the dive | |
199 */ | |
200 typedef struct | |
201 { | |
202 uint32_t header; | |
203 uint8_t warning_blink_dsec; | |
204 uint8_t lastDiveLogId; | |
205 uint32_t logFlashNextSampleStartAddress; | |
206 SGasLine gas[1 + (2*NUM_GASES)]; | |
207 SSetpointLine setpoint[1 + NUM_GASES]; | |
208 uint8_t CCR_Mode; | |
209 uint8_t dive_mode; | |
210 split2x4_Type deco_type; | |
211 uint8_t ppO2_max_deco; | |
212 uint8_t ppO2_max_std; | |
213 uint8_t ppO2_min; | |
214 uint8_t CNS_max; | |
215 uint8_t ascent_MeterPerMinute_max; | |
216 uint8_t ascent_MeterPerMinute_showGraph; | |
217 uint8_t future_TTS; | |
218 uint8_t GF_high; | |
219 uint8_t GF_low; | |
220 uint8_t aGF_high; | |
221 uint8_t aGF_low; | |
222 split2x4_Type VPM_conservatism; | |
223 uint8_t safetystopDuration; | |
224 uint8_t AtemMinutenVolumenLiter; | |
225 uint8_t ReserveFractionDenominator; | |
226 uint8_t salinity; | |
227 uint8_t last_stop_depth_meter; | |
228 uint8_t stop_increment_depth_meter; | |
229 uint8_t brightness; | |
230 uint8_t date_format; | |
231 uint8_t selected_language; | |
232 char customtext[60]; | |
233 uint16_t timeoutSurfacemode; | |
234 uint8_t timeoutMenuSurface; | |
235 uint8_t timeoutMenuDive; | |
236 uint8_t timeoutMenuEdit; | |
237 uint8_t timeoutInfo; | |
238 uint8_t timeoutInfoCompass; | |
239 uint8_t design; | |
240 uint16_t timeoutDiveReachedZeroDepth; | |
241 uint16_t divetimeToCreateLogbook; | |
242 uint8_t serialHigh; | |
243 uint8_t serialLow; | |
244 // SUFirmware firmwareVersion16to32bit; | |
245 uint32_t backup_localtime_rtc_tr; | |
246 uint32_t backup_localtime_rtc_dr; | |
247 uint16_t totalDiveCounter; | |
560
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
248 uint16_t personalDiveCount; |
38 | 249 uint8_t showDebugInfo; |
250 uint8_t ButtonResponsiveness[4];// changed content in 0xFFFF0016 | |
251 uint8_t nonMetricalSystem; | |
252 uint8_t fallbackToFixedSetpoint; | |
253 uint8_t bluetoothActive; /* will be set to zero on each startup at the moment */ | |
254 uint8_t safetystopDepth; | |
255 uint32_t updateSettingsAllowedFromHeader; | |
662 | 256 uint8_t pscr_lung_ratio; /* redefined in 0xFFFF0020 */ |
257 uint8_t pscr_o2_drop; /* redefined in 0xFFFF0020 */ | |
258 uint8_t co2_sensor_active; /* redefined in 0xFFFF0021 */ | |
691 | 259 uint8_t ext_uart_protocol; /* redefined in 0xFFFF0022 */ |
710 | 260 |
261 uint8_t scubberActiveId; /* redefined in 0xFFFF0023 */ | |
262 SScrubberData scrubberData[2]; | |
796 | 263 uint8_t ext_sensor_map_Obsolete[5]; |
264 uint8_t buttonLockActive; /* redefined in 0xFFFF0025 */ | |
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)
heinrichsweikamp
parents:
776
diff
changeset
|
265 int8_t compassDeclinationDeg; |
805
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
796
diff
changeset
|
266 uint8_t delaySetpointLow; |
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
796
diff
changeset
|
267 uint16_t timerDurationS; /* redefined in 0xFFFF0026 */ |
662 | 268 uint8_t Future_SPARE[FUTURE_SPARE_SIZE]; /* redefined in 0xFFFF0020 (old scooter Block was 32 byte)*/ |
38 | 269 // new in 0xFFFF0006 |
270 uint8_t ppo2sensors_deactivated; | |
271 uint8_t tX_colorscheme; | |
272 uint8_t tX_userselectedLeftLowerCornerPrimary; | |
273 uint8_t tX_userselectedLeftLowerCornerTimeout; | |
274 uint8_t tX_customViewPrimary; | |
275 uint8_t tX_customViewTimeout; | |
276 uint8_t timeoutEnterButtonSelectDive; | |
277 uint16_t logbookOffset; | |
278 uint8_t alwaysShowPPO2; | |
279 uint8_t extraDisplay; | |
280 uint16_t display_toogle_desc; | |
281 int8_t offsetPressure_mbar; | |
282 int8_t offsetTemperature_centigrad; | |
283 uint8_t gasConsumption_travel_l_min; | |
284 uint8_t gasConsumption_bottom_l_min; | |
285 uint8_t gasConsumption_deco_l_min; | |
286 uint8_t debugModeOnStart; | |
287 uint8_t IAmStolenPleaseKillMe; | |
288 int16_t compassBearing; | |
289 uint8_t lastKnownBatteryPercentage; | |
290 uint8_t buttonBalance[3]; // 0 = right, 1 = center, 2 = left | |
291 uint8_t firmwareVersion[4]; | |
292 uint16_t timeoutSurfacemodeWithSensors; | |
293 // new in 0xFFFF0016 | |
294 uint8_t VPM_model; | |
295 uint8_t GF_model; | |
296 // new in 0xFFFF0017 | |
297 uint8_t FactoryButtonBase; | |
298 uint8_t FactoryButtonBalance[3]; | |
112
fdf0272e9213
Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents:
38
diff
changeset
|
299 /* new in 0xFFFF0018 */ |
fdf0272e9213
Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents:
38
diff
changeset
|
300 uint8_t FlipDisplay; |
210
b2a9e9b02df0
New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents:
138
diff
changeset
|
301 /* new in 0xFFFF0019 */ |
b2a9e9b02df0
New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents:
138
diff
changeset
|
302 uint32_t cv_configuration; |
368
50ea68c7a153
Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents:
210
diff
changeset
|
303 /* new in 0xFFFF001A */ |
50ea68c7a153
Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents:
210
diff
changeset
|
304 uint8_t MotionDetection; |
498
4811f3dfaa52
Added dew parameter to enable selection of customer BigFont screens to be displayed
Ideenmodellierer
parents:
372
diff
changeset
|
305 /* new in 0xFFFF001B */ |
4811f3dfaa52
Added dew parameter to enable selection of customer BigFont screens to be displayed
Ideenmodellierer
parents:
372
diff
changeset
|
306 uint32_t cv_config_BigScreen; |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
526
diff
changeset
|
307 /* new in 0xFFFF001C */ |
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
526
diff
changeset
|
308 uint8_t compassInertia; |
542
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
539
diff
changeset
|
309 uint8_t tX_customViewPrimaryBF; |
546 | 310 /* new in 0xFFFF001D */ |
626
3e1a0e267f38
Added option to select sensitivity of focus detection:
Ideenmodellierer
parents:
567
diff
changeset
|
311 uint8_t viewPortMode; /* 7-Reserve| 6..5 - Focus spot size | 4-Focusframe | 3-Reserve | 2..0-BacklightBoost */ |
546 | 312 uint16_t viewRoll; |
313 uint16_t viewPitch; | |
314 uint16_t viewYaw; | |
560
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
315 /* new in 0xFFFF001E */ |
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
316 uint8_t ppo2sensors_source; |
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
317 float ppo2sensors_calibCoeff[3]; |
567 | 318 uint8_t amPMTime; |
650 | 319 /* new in 0xFFFF001F */ |
320 uint8_t autoSetpoint; | |
710 | 321 uint16_t scrubTimerMax_Obsolete; /* have been replaced with new scrubber data format */ |
322 uint16_t scrubTimerCur_Obsolete; /* have been replaced with new scrubber data format */ | |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
652
diff
changeset
|
323 uint8_t scrubTimerMode; |
796 | 324 uint8_t ext_sensor_map[8]; /* redefined in 0xFFFF0027 */ |
834
2a8af51ab04d
Added event based display changes for big font view:
Ideenmodellierer
parents:
830
diff
changeset
|
325 uint8_t cvAutofocus; |
882 | 326 uint8_t slowExitTime; |
949 | 327 /* new in 0xFFFF002c */ |
328 StimeZone timeZone; | |
951 | 329 uint8_t warningBuzzer; |
38 | 330 } SSettings; |
331 | |
332 typedef struct | |
333 { | |
334 // 8 bytes | |
335 uint16_t primarySerial; | |
336 uint8_t primaryLicence; | |
337 uint8_t revision8bit; | |
338 uint8_t production_year; | |
339 uint8_t production_month; | |
340 uint8_t production_day; | |
341 uint8_t production_bluetooth_name_set; | |
342 | |
343 // 44 bytes | |
344 char production_info[44]; | |
345 | |
346 // 8 bytes | |
347 uint16_t secondarySerial; | |
348 uint8_t secondaryLicence; | |
349 uint8_t secondaryReason8bit; | |
350 uint8_t secondary_year; | |
351 uint8_t secondary_month; | |
352 uint8_t secondary_day; | |
353 uint8_t secondary_bluetooth_name_set; | |
354 | |
355 // 4 bytes | |
356 char secondary_info[4]; | |
357 } SHardwareData; | |
358 | |
359 uint8_t writeData(uint8_t *); | |
360 uint8_t readData(uint8_t what,uint8_t *); | |
361 uint8_t readDataLimits__8and16BitValues_4and7BytesOutput(uint8_t what, uint8_t * data); | |
362 | |
363 uint8_t getPPO2Max(void); | |
364 uint8_t getPPO2Min(void); | |
365 uint8_t getDiveMode(void); | |
366 uint8_t getCCRMode(void); | |
367 uint8_t getDecoType(void); | |
368 uint8_t getFutureTTS(void); | |
369 | |
370 SSettings* settingsGetPointer(void); | |
371 const SSettings* settingsGetPointerStandard(void); | |
372 void set_settings_to_Standard(void); | |
373 void mod_settings_for_first_start_with_empty_ext_flash(void); | |
374 const SFirmwareData* firmwareDataGetPointer(void); | |
375 const SHardwareData* hardwareDataGetPointer(void); | |
376 uint8_t firmwareVersion_16bit_high(void); | |
377 uint8_t firmwareVersion_16bit_low(void); | |
378 void hardwareBatchCode(uint8_t *high, uint8_t *low); | |
379 | |
380 uint8_t RTEminimum_required_high(void); | |
381 uint8_t RTEminimum_required_low(void); | |
382 uint8_t FONTminimum_required_high(void); | |
383 uint8_t FONTminimum_required_low(void); | |
384 | |
385 void setActualRTEversion(uint8_t high, uint8_t low); | |
386 void getActualRTEandFONTversion(uint8_t *RTEhigh, uint8_t *RTElow, uint8_t *FONThigh, uint8_t *FONTlow); | |
387 | |
388 void set_new_settings_missing_in_ext_flash(void); | |
389 uint8_t check_and_correct_settings(void); | |
390 uint8_t newFirmwareVersionCheckViaSettings(void); | |
765
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
758
diff
changeset
|
391 void set_settings_button_to_factory_with_individual_buttonBalance(void); |
38 | 392 uint8_t getLicence(void); |
393 void firmwareGetDate(RTC_DateTypeDef *SdateOutput); | |
394 | |
395 void settingsHelperButtonSens_original_translate_to_hwOS_values(const uint32_t inputValueRaw, uint8_t *outArray4Values); | |
396 | |
397 uint8_t buttonBalanceTranslatorHexToArray(uint8_t hexValue, uint8_t* outputArray); | |
398 uint8_t buttonBalanceTranslateArrayOutHex(const uint8_t* inputArray); | |
399 void getButtonFactorDefaults(uint8_t* basePercentage, uint8_t* buttonBalanceArray); | |
400 void settingsWriteFactoryDefaults(uint8_t inputValueRaw, uint8_t *inputBalanceArray); | |
401 | |
402 void settingsHelperButtonSens_keepPercentageValues(uint32_t inputValueRaw, uint8_t *outArray4Values); | |
403 uint8_t settingsHelperButtonSens_translate_percentage_to_hwOS_values(uint8_t inputValuePercentage); | |
404 uint8_t settingsHelperButtonSens_translate_hwOS_values_to_percentage(uint8_t inputValuePIC); | |
405 | |
819
24b39a432bc2
Added debug information in case an error in the settings has been detected:
Ideenmodellierer
parents:
805
diff
changeset
|
406 void get_CorrectionStatus(SSettingsStatus* Status); |
662 | 407 void reset_SettingWarning(); |
408 uint8_t isSettingsWarning(); | |
409 | |
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)
heinrichsweikamp
parents:
776
diff
changeset
|
410 bool checkAndFixSetpointSettings(void); |
38 | 411 #endif // SETTINGS_H |