Mercurial > public > ostc4
annotate Discovery/Src/settings.c @ 1082:1aa45000f92c Icon_Integration tip
Added configuration menu for HUD functions:
The V1 HUD has 4 functions (holes) which may be realized by one or two LEDs. The functions (like ppo2 monitoring or ascent speed) may be configurated by the diver using the HUD menu. The functions which may be selected depend on the HW configuration (e.g. the connected sensors) and the number of LEDs which are needed to realize the function. The previous HUD test implementation may still be activate usind the compile switch ENABLE_HUD_TESTING
| author | Ideenmodellierer |
|---|---|
| date | Sun, 15 Mar 2026 21:40:35 +0100 |
| parents | 3c3fb9f4edc4 |
| children |
| rev | line source |
|---|---|
| 38 | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 /// -*- coding: UTF-8 -*- | |
| 3 /// | |
| 4 /// \file Discovery/Src/settings.c | |
| 5 /// \brief settingsHelperButtonSens_translate_hwOS_values_to_percentage. | |
| 6 /// \author Heinrichs Weikamp gmbh | |
| 7 /// \date 6-March-2017 | |
| 8 /// | |
| 9 /// \details | |
| 10 /// | |
| 11 /// $Id$ | |
| 12 /////////////////////////////////////////////////////////////////////////////// | |
| 13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
| 14 /// | |
| 15 /// This program is free software: you can redistribute it and/or modify | |
| 16 /// it under the terms of the GNU General Public License as published by | |
| 17 /// the Free Software Foundation, either version 3 of the License, or | |
| 18 /// (at your option) any later version. | |
| 19 /// | |
| 20 /// This program is distributed in the hope that it will be useful, | |
| 21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 23 /// GNU General Public License for more details. | |
| 24 /// | |
| 25 /// You should have received a copy of the GNU General Public License | |
| 26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 27 ////////////////////////////////////////////////////////////////////////////// | |
| 28 | |
| 29 #include <string.h> | |
|
765
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
30 |
| 38 | 31 #include "settings.h" |
| 32 #include "firmwareEraseProgram.h" // for HARDWAREDATA_ADDRESS | |
| 33 #include "externLogbookFlash.h" // for SAMPLESTART and SAMPLESTOP | |
| 34 #include "text_multilanguage.h" // for LANGUAGE_END | |
| 35 #include "tHome.h" // for CVIEW_END | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
36 #include "tMenu.h" |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
37 #include "tMenuEdit.h" |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
38 #include "tInfo.h" |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
39 #include "tInfoLog.h" |
|
389
ebc2b571a0b9
Fix case for case sensitive OS
Jan Mulder <jan@jlmulder.nl>
parents:
382
diff
changeset
|
40 #include "motion.h" |
|
443
a5101c688b49
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
439
diff
changeset
|
41 #include "t7.h" |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
533
diff
changeset
|
42 #include "data_central.h" |
|
1082
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
43 #include "hud.h" |
| 38 | 44 |
| 662 | 45 static uint8_t settingsWarning = 0; /* Active if setting values have been corrected */ |
| 820 | 46 static SSettingsStatus SettingsStatus; /* Structure containing number of corrections and first occurrence */ |
| 662 | 47 |
| 38 | 48 SSettings Settings; |
| 49 | |
| 1027 | 50 SSettings Profile[NUMBER_OF_PROFILES]; /* may be optimized if RAM is getting short. profile copies are only used by profile dialog */ |
| 51 /* static structure is used to keep things simple avoiding larger code changes */ | |
|
728
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
715
diff
changeset
|
52 const uint8_t RTErequiredHigh = 3; |
| 1068 | 53 const uint8_t RTErequiredLow = 8; |
| 38 | 54 |
| 75 | 55 const uint8_t FONTrequiredHigh = 1; |
| 56 const uint8_t FONTrequiredLow = 0; | |
| 38 | 57 |
| 58 uint8_t RTEactualHigh = 0; | |
| 59 uint8_t RTEactualLow = 0; | |
| 60 | |
| 61 // =============================================================================== | |
| 62 // SFirmwareData FirmwareData | |
| 63 /// @brief internal counter is for changes after last release | |
| 64 /// use date and info as well for this purpose | |
| 65 /// | |
| 66 // =============================================================================== | |
| 67 | |
| 68 const SFirmwareData firmware_FirmwareData __attribute__( (section(".firmware_firmware_data")) ) = | |
| 69 { | |
| 70 .versionFirst = 1, | |
|
990
d63584d6428d
increase version number, add the download documentation
heinrichsweikamp
parents:
982
diff
changeset
|
71 .versionSecond = 7, |
| 1068 | 72 .versionThird = 6, |
| 73 .versionBeta = 0, | |
| 38 | 74 |
| 75 /* 4 bytes with trailing 0 */ | |
|
55
a7683f9765da
Italian activated (needs some fine tuning), special characters (?,?,?,?,? and others) currently not working...
heinrichsweikamp
parents:
48
diff
changeset
|
76 .signature = "mh", |
| 38 | 77 |
| 1068 | 78 .release_year = 26, |
| 79 .release_month = 02, | |
| 80 .release_day = 17, | |
| 38 | 81 .release_sub = 0, |
| 82 | |
| 83 /* max 48 with trailing 0 */ | |
| 84 //release_info ="12345678901234567890123456789012345678901" | |
|
286
733877ab87d9
Minor: Some Texts fixed, allign RTErequired* values with RTE firmware
heinrichsweikamp
parents:
274
diff
changeset
|
85 .release_info ="gcc_2nd", |
| 38 | 86 |
| 87 /* for safety reasons and coming functions */ | |
| 88 .magic[0] = FIRMWARE_MAGIC_FIRST, | |
| 89 .magic[1] = FIRMWARE_MAGIC_SECOND, | |
| 90 .magic[2] = FIRMWARE_MAGIC_FIRMWARE, /* the magic byte */ | |
| 91 .magic[3] = FIRMWARE_MAGIC_END | |
| 92 }; | |
| 93 | |
| 94 | |
| 95 /* always adjust check_and_correct_settings() accordingly | |
| 96 * There might even be entries with fixed values that have no range | |
| 97 */ | |
| 98 const SSettings SettingsStandard = { | |
|
1082
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
99 .header = 0xFFFF002F, |
| 38 | 100 .warning_blink_dsec = 8 * 2, |
| 101 .lastDiveLogId = 0, | |
| 662 | 102 .logFlashNextSampleStartAddress = SAMPLESTART, |
| 38 | 103 |
| 104 .gas[0].oxygen_percentage = 21, | |
| 105 .gas[1].oxygen_percentage = 21, | |
| 106 .gas[2].oxygen_percentage = 21, | |
| 107 .gas[3].oxygen_percentage = 21, | |
| 108 .gas[4].oxygen_percentage = 21, | |
| 109 .gas[5].oxygen_percentage = 21, | |
| 110 .gas[6].oxygen_percentage = 21, | |
| 111 .gas[7].oxygen_percentage = 21, | |
| 112 .gas[8].oxygen_percentage = 21, | |
| 113 .gas[9].oxygen_percentage = 21, | |
| 114 .gas[10].oxygen_percentage = 21, | |
| 115 .gas[0].helium_percentage = 0, | |
| 116 .gas[1].helium_percentage = 0, | |
| 117 .gas[2].helium_percentage = 0, | |
| 118 .gas[3].helium_percentage = 0, | |
| 119 .gas[4].helium_percentage = 0, | |
| 120 .gas[5].helium_percentage = 0, | |
| 121 .gas[6].helium_percentage = 0, | |
| 122 .gas[7].helium_percentage = 0, | |
| 123 .gas[8].helium_percentage = 0, | |
| 124 .gas[9].helium_percentage = 0, | |
| 125 .gas[10].helium_percentage = 0, | |
| 126 .gas[0].depth_meter = 0, | |
| 127 .gas[1].depth_meter = 0, | |
| 128 .gas[2].depth_meter = 0, | |
| 129 .gas[3].depth_meter = 0, | |
| 130 .gas[4].depth_meter = 0, | |
| 131 .gas[5].depth_meter = 0, | |
| 132 .gas[6].depth_meter = 0, | |
| 133 .gas[7].depth_meter = 0, | |
| 134 .gas[8].depth_meter = 0, | |
| 135 .gas[9].depth_meter = 0, | |
| 136 .gas[10].depth_meter = 0, | |
| 137 .gas[0].depth_meter_travel = 0, | |
| 138 .gas[1].depth_meter_travel = 0, | |
| 139 .gas[2].depth_meter_travel = 0, | |
| 140 .gas[3].depth_meter_travel = 0, | |
| 141 .gas[4].depth_meter_travel = 0, | |
| 142 .gas[5].depth_meter_travel = 0, | |
| 143 .gas[6].depth_meter_travel = 0, | |
| 144 .gas[7].depth_meter_travel = 0, | |
| 145 .gas[8].depth_meter_travel = 0, | |
| 146 .gas[9].depth_meter_travel = 0, | |
| 147 .gas[10].depth_meter_travel = 0, | |
| 148 .gas[0].note.uw = 0, | |
| 149 .gas[1].note.ub.first = 1, | |
| 150 .gas[1].note.ub.active = 1, | |
| 151 .gas[1].note.ub.deco = 0, | |
| 152 .gas[1].note.ub.travel = 0, | |
| 153 .gas[2].note.uw = 0, | |
| 154 .gas[3].note.uw = 0, | |
| 155 .gas[4].note.uw = 0, | |
| 156 .gas[5].note.uw = 0, | |
| 157 .gas[6].note.ub.first = 1, | |
| 158 .gas[6].note.ub.active = 1, | |
| 159 .gas[6].note.ub.deco = 0, | |
| 160 .gas[6].note.ub.travel = 0, | |
| 161 .gas[7].note.uw = 0, | |
| 162 .gas[8].note.uw = 0, | |
| 163 .gas[9].note.uw = 0, | |
| 164 .gas[10].note.uw = 0, | |
| 165 .gas[0].bottle_size_liter = 0, | |
| 166 .gas[1].bottle_size_liter = 0, | |
| 167 .gas[2].bottle_size_liter = 0, | |
| 168 .gas[3].bottle_size_liter = 0, | |
| 169 .gas[4].bottle_size_liter = 0, | |
| 170 .gas[5].bottle_size_liter = 0, | |
| 171 .gas[6].bottle_size_liter = 0, | |
| 172 .gas[7].bottle_size_liter = 0, | |
| 173 .gas[8].bottle_size_liter = 0, | |
| 174 .gas[9].bottle_size_liter = 0, | |
| 175 .gas[10].bottle_size_liter = 0, | |
| 176 /* | |
| 177 .gas[0].bottle_wireless_status = 0, | |
| 178 .gas[1].bottle_wireless_status = 0, | |
| 179 .gas[2].bottle_wireless_status = 0, | |
| 180 .gas[3].bottle_wireless_status = 0, | |
| 181 .gas[4].bottle_wireless_status = 0, | |
| 182 .gas[5].bottle_wireless_status = 0, | |
| 183 .gas[6].bottle_wireless_status = 0, | |
| 184 .gas[7].bottle_wireless_status = 0, | |
| 185 .gas[8].bottle_wireless_status = 0, | |
| 186 .gas[9].bottle_wireless_status = 0, | |
| 187 .gas[10].bottle_wireless_status = 0, | |
| 188 */ | |
| 189 .gas[0].bottle_wireless_id = 0, | |
| 190 .gas[1].bottle_wireless_id = 0, | |
| 191 .gas[2].bottle_wireless_id = 0, | |
| 192 .gas[3].bottle_wireless_id = 0, | |
| 193 .gas[4].bottle_wireless_id = 0, | |
| 194 .gas[5].bottle_wireless_id = 0, | |
| 195 .gas[6].bottle_wireless_id = 0, | |
| 196 .gas[7].bottle_wireless_id = 0, | |
| 197 .gas[8].bottle_wireless_id = 0, | |
| 198 .gas[9].bottle_wireless_id = 0, | |
| 199 .gas[10].bottle_wireless_id = 0, | |
| 200 .setpoint[0].setpoint_cbar = 100, | |
| 201 .setpoint[1].setpoint_cbar = 70, | |
| 202 .setpoint[2].setpoint_cbar = 90, | |
| 203 .setpoint[3].setpoint_cbar = 100, | |
| 204 .setpoint[4].setpoint_cbar = 120, | |
| 205 .setpoint[5].setpoint_cbar = 140, | |
| 206 .setpoint[0].depth_meter = 0, | |
| 207 .setpoint[1].depth_meter = 0, | |
| 208 .setpoint[2].depth_meter = 0, | |
| 209 .setpoint[3].depth_meter = 0, | |
| 210 .setpoint[4].depth_meter = 0, | |
| 211 .setpoint[5].depth_meter = 0, | |
| 212 .setpoint[0].note.uw = 0, | |
| 213 .setpoint[1].note.ub.active = 1, | |
| 214 .setpoint[1].note.ub.first = 1, | |
| 215 .setpoint[2].note.ub.active = 1, | |
| 216 .setpoint[2].note.ub.first = 0, | |
| 217 .setpoint[3].note.ub.active = 1, | |
| 218 .setpoint[3].note.ub.first = 0, | |
| 219 .setpoint[4].note.ub.active = 1, | |
| 220 .setpoint[4].note.ub.first = 0, | |
| 221 .setpoint[5].note.ub.active = 1, | |
| 222 .setpoint[5].note.ub.first = 0, | |
| 223 | |
| 224 .CCR_Mode = CCRMODE_Sensors, | |
| 225 .dive_mode = DIVEMODE_OC, | |
| 226 .deco_type.ub.standard = GF_MODE, | |
| 227 .deco_type.ub.alternative = GF_MODE, | |
| 228 .ppO2_max_deco = 160, | |
| 229 .ppO2_max_std = 140, | |
| 230 .ppO2_min = 15, | |
| 231 .CNS_max = 90, | |
| 232 .ascent_MeterPerMinute_max = 30, | |
| 662 | 233 .ascent_MeterPerMinute_showGraph = 30, |
| 38 | 234 .future_TTS = 5, |
| 235 .GF_high = 85, | |
| 236 .GF_low = 30, | |
| 237 .aGF_high = 95, | |
| 238 .aGF_low = 95, | |
| 239 .VPM_conservatism.ub.standard = 2, | |
| 240 .VPM_conservatism.ub.alternative = 0, | |
| 241 .safetystopDuration = 1, | |
| 242 .AtemMinutenVolumenLiter = 25, | |
| 243 .ReserveFractionDenominator = 4, | |
| 244 .salinity = 0, | |
| 245 .last_stop_depth_meter = 3, | |
| 246 .stop_increment_depth_meter = 3, | |
| 247 .brightness = 1, | |
| 248 .date_format = DDMMYY, | |
| 249 .selected_language = 0, /* 0 = LANGUAGE_English */ | |
| 250 .customtext = " <your name>\n" " <address>", | |
| 251 .timeoutSurfacemode = 120, | |
| 252 .timeoutMenuSurface = 120,//240, | |
| 253 .timeoutMenuDive = 120,//20, | |
| 254 .timeoutMenuEdit = 120,//40, | |
| 255 .timeoutInfo = 120,//60, | |
| 256 .timeoutInfoCompass = 60, | |
| 257 .design = 7, | |
| 258 .timeoutDiveReachedZeroDepth = 300, | |
| 259 .divetimeToCreateLogbook = 60, | |
| 260 .serialHigh = 0, | |
| 261 .serialLow = 2, | |
| 262 /* | |
| 263 .firmwareVersion16to32bit.ub.first = 0, | |
| 264 .firmwareVersion16to32bit.ub.second = 6, | |
| 265 .firmwareVersion16to32bit.ub.third = 0, | |
| 266 .firmwareVersion16to32bit.ub.betaFlag = 0, | |
| 267 */ | |
| 268 .backup_localtime_rtc_tr = 0, | |
| 269 .backup_localtime_rtc_dr = 0, | |
| 270 .totalDiveCounter = 0, | |
| 271 .personalDiveCount = 0, | |
| 272 .showDebugInfo = 0, | |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
273 .ButtonResponsiveness[0] = DEFAULT_BUTTONRESPONSIVENESS_GUI, // new hw 170306 |
|
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
274 .ButtonResponsiveness[1] = DEFAULT_BUTTONRESPONSIVENESS_GUI, // new hw 170306 |
|
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
275 .ButtonResponsiveness[2] = DEFAULT_BUTTONRESPONSIVENESS_GUI, // new hw 170306 |
|
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
276 .ButtonResponsiveness[3] = DEFAULT_BUTTONRESPONSIVENESS_GUI, // new hw 170306 |
| 38 | 277 .nonMetricalSystem = 0, |
| 278 .fallbackToFixedSetpoint = 1, | |
| 279 .bluetoothActive = 0, | |
| 280 .safetystopDepth = 5, | |
| 281 .updateSettingsAllowedFromHeader = 0xFFFF0002, | |
| 662 | 282 .pscr_lung_ratio = 10, |
| 283 .pscr_o2_drop = 4, | |
| 284 .co2_sensor_active = 0, | |
| 38 | 285 .ppo2sensors_deactivated = 0, |
| 286 .tX_colorscheme = 0, | |
|
443
a5101c688b49
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
439
diff
changeset
|
287 .tX_userselectedLeftLowerCornerPrimary = LLC_Temperature, |
| 38 | 288 .tX_userselectedLeftLowerCornerTimeout = 0, |
| 289 .tX_customViewPrimary = 1, | |
| 290 .tX_customViewTimeout = 0, | |
| 291 .timeoutEnterButtonSelectDive = 10, | |
| 292 .logbookOffset = 0, | |
| 293 .alwaysShowPPO2 = 0, | |
| 294 .extraDisplay = EXTRADISPLAY_BIGFONT, | |
| 295 .display_toogle_desc = 200, | |
| 296 .offsetPressure_mbar = 0, | |
| 297 .offsetTemperature_centigrad = 0, | |
| 298 .gasConsumption_travel_l_min = 30, | |
| 299 .gasConsumption_bottom_l_min = 30, | |
| 300 .gasConsumption_deco_l_min = 20, | |
| 301 .debugModeOnStart = 0, | |
| 302 .compassBearing = 0, | |
| 303 .lastKnownBatteryPercentage = 0, | |
| 304 .buttonBalance[0] = 3, | |
| 305 .buttonBalance[1] = 3, | |
| 306 .buttonBalance[2] = 3, | |
| 307 .firmwareVersion[0] = 0,//FirmwareData.firmwareVersion16to32bit.ub.first, | |
| 308 .firmwareVersion[1] = 0,//FirmwareData.firmwareVersion16to32bit.ub.second, | |
| 309 .firmwareVersion[2] = 0,//FirmwareData.firmwareVersion16to32bit.ub.third, | |
| 310 .firmwareVersion[3] = 0,//FirmwareData.firmwareVersion16to32bit.ub.betaFlag, | |
| 311 .timeoutSurfacemodeWithSensors = 600, | |
| 312 .VPM_model = 0, | |
| 313 .GF_model = 0, | |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
314 .FactoryButtonBase = DEFAULT_BUTTONRESPONSIVENESS_GUI, |
| 38 | 315 .FactoryButtonBalance[0] = 3, |
| 316 .FactoryButtonBalance[1] = 3, | |
| 317 .FactoryButtonBalance[2] = 3, | |
|
111
38785aa95837
Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents:
75
diff
changeset
|
318 .FlipDisplay = 0, |
|
210
b2a9e9b02df0
New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents:
172
diff
changeset
|
319 .cv_configuration = 0xFFFFFFFF, |
|
375
4bb5ceebfaf9
Use Enum values for initialization and setting check:
ideenmodellierer
parents:
372
diff
changeset
|
320 .MotionDetection = MOTION_DETECT_OFF, |
|
498
4811f3dfaa52
Added dew parameter to enable selection of customer BigFont screens to be displayed
Ideenmodellierer
parents:
492
diff
changeset
|
321 .cv_config_BigScreen = 0xFFFFFFFF, |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
533
diff
changeset
|
322 .compassInertia = 0, |
|
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
323 .tX_customViewPrimaryBF = CVIEW_T3_Decostop, |
| 546 | 324 .viewPortMode = 0, |
| 325 .viewRoll = 0, | |
| 326 .viewPitch = 0, | |
| 327 .viewYaw = 0, | |
|
560
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
328 .ppo2sensors_source = 0, |
|
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
329 .ppo2sensors_calibCoeff[0] = 0.0, |
|
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
330 .ppo2sensors_calibCoeff[1] = 0.0, |
|
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
331 .ppo2sensors_calibCoeff[2] = 0.0, |
| 567 | 332 .amPMTime = 0, |
| 650 | 333 .autoSetpoint = 0, |
| 710 | 334 .scrubTimerMax_Obsolete = 0, |
| 335 .scrubTimerCur_Obsolete = 0, | |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
336 .scrubTimerMode = SCRUB_TIMER_MINUTES, |
| 733 | 337 .ext_sensor_map[0] = SENSOR_OPTIC, |
| 338 .ext_sensor_map[1] = SENSOR_OPTIC, | |
| 339 .ext_sensor_map[2] = SENSOR_OPTIC, | |
|
728
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
715
diff
changeset
|
340 .ext_sensor_map[3] = SENSOR_NONE, |
|
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
715
diff
changeset
|
341 .ext_sensor_map[4] = SENSOR_NONE, |
| 796 | 342 .ext_sensor_map[5] = SENSOR_NONE, |
| 343 .ext_sensor_map[6] = SENSOR_NONE, | |
| 344 .ext_sensor_map[7] = SENSOR_NONE, | |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
768
diff
changeset
|
345 .buttonLockActive = 0, |
|
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
768
diff
changeset
|
346 .compassDeclinationDeg = 0, |
|
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
|
347 .delaySetpointLow = false, |
|
805
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
801
diff
changeset
|
348 .timerDurationS = 180, |
|
834
2a8af51ab04d
Added event based display changes for big font view:
Ideenmodellierer
parents:
830
diff
changeset
|
349 .cvAutofocus = 0, |
| 949 | 350 .slowExitTime = 0, |
| 351 .timeZone.hours = 0, | |
| 951 | 352 .timeZone.minutes = 0, |
| 1027 | 353 .warningBuzzer = 0, |
| 354 .profileName[0] = "STANDARD", | |
| 355 .profileName[1] = "OC_TX___", | |
| 356 .profileName[2] = "MCCR____", | |
| 357 .profileName[3] = "ECCR____", | |
| 358 .activeProfile = 0, | |
|
1082
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
359 .hudFunction[0] = HUD_FCT_NONE, |
|
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
360 .hudFunction[1] = HUD_FCT_NONE, |
|
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
361 .hudFunction[2] = HUD_FCT_NONE, |
|
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
362 .hudFunction[3] = HUD_FCT_NONE, |
|
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
363 .hudFunction[4] = HUD_FCT_NONE, |
|
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
364 .hudFunction[5] = HUD_FCT_NONE |
| 38 | 365 }; |
| 366 | |
| 367 /* Private function prototypes -----------------------------------------------*/ | |
| 368 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to); | |
| 369 | |
| 1027 | 370 /* The profiles are store in a 4k flash block => make sure that size does not violate the size of the flash block (settings * 4) */ |
| 371 _Static_assert(sizeof(Settings) < 1000, "To much settings to support multiple profiles"); | |
| 372 | |
| 373 | |
| 38 | 374 /* Functions -----------------------------------------------------------------*/ |
| 375 | |
| 1027 | 376 |
| 377 uint16_t settingsGetSize() | |
| 378 { | |
| 379 return sizeof (Settings); | |
| 380 } | |
| 381 | |
| 382 | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
383 void setFlipDisplay(uint8_t flipDisplay) |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
384 { |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
385 bool settingChanged = flipDisplay != Settings.FlipDisplay; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
386 Settings.FlipDisplay = flipDisplay; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
387 if (settingChanged) { |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
388 // reinit all views |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
389 tHome_init(); |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
390 tI_init(); |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
391 tM_init(); |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
392 tMenuEdit_init(); |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
393 tInfoLog_init(); |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
394 tM_build_pages(); |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
395 GFX_build_logo_frame(); |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
396 GFX_build_hw_background_frame(); |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
397 } |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
398 } |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
399 |
| 38 | 400 |
| 401 // =============================================================================== | |
| 402 // set_new_settings_missing_in_ext_flash | |
| 403 /// @brief Add all the new setting variables of this version | |
| 404 /// or/and change what has changed in the meantime | |
| 405 /// | |
| 406 /// Additionally update the serial number if written via bluetooth | |
| 407 /// | |
| 408 // =============================================================================== | |
| 820 | 409 SSettings* pSettings; |
| 1027 | 410 void set_new_settings_missing_in_ext_flash(uint8_t whichSettings) |
| 38 | 411 { |
| 820 | 412 uint32_t tmp = 0; |
| 1027 | 413 pSettings = settingsGetPointer(); |
| 820 | 414 |
| 1027 | 415 switch(whichSettings) |
| 416 { | |
| 417 default: | |
| 418 case EF_SETTINGS: | |
| 419 break; | |
| 420 case EF_PROFILE0: pSettings = profileGetPointer(0); | |
| 421 break; | |
| 422 case EF_PROFILE1: pSettings = profileGetPointer(1); | |
| 423 break; | |
| 424 case EF_PROFILE2: pSettings = profileGetPointer(2); | |
| 425 break; | |
| 426 case EF_PROFILE3: pSettings = profileGetPointer(3); | |
| 427 break; | |
| 428 } | |
| 38 | 429 // never delete this part setting the serial |
| 430 if(hardwareDataGetPointer()->secondarySerial != 0xFFFF) | |
| 431 { | |
| 1027 | 432 pSettings->serialHigh = (hardwareDataGetPointer()->secondarySerial / 256); |
| 433 pSettings->serialLow = (hardwareDataGetPointer()->secondarySerial & 0xFF); | |
| 38 | 434 } |
| 435 else | |
| 436 if(hardwareDataGetPointer()->primarySerial != 0xFFFF) | |
| 437 { | |
| 1027 | 438 pSettings->serialHigh = (hardwareDataGetPointer()->primarySerial / 256); |
| 439 pSettings->serialLow = (hardwareDataGetPointer()->primarySerial & 0xFF); | |
| 38 | 440 } |
| 441 else | |
| 442 { | |
| 1027 | 443 pSettings->serialHigh = 0; |
| 444 pSettings->serialLow = 0; | |
| 38 | 445 } |
| 446 | |
| 1027 | 447 pSettings->firmwareVersion[0] = firmware_FirmwareData.versionFirst; |
| 448 pSettings->firmwareVersion[1] = firmware_FirmwareData.versionSecond; | |
| 449 pSettings->firmwareVersion[2] = firmware_FirmwareData.versionThird; | |
| 450 pSettings->firmwareVersion[3] = firmware_FirmwareData.versionBeta; | |
| 38 | 451 |
| 1027 | 452 |
| 38 | 453 const SSettings* pStandard = settingsGetPointerStandard(); |
| 454 | |
|
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:
324
diff
changeset
|
455 /* Pointing to the old header data => set new data depending on what had been added since last version */ |
| 38 | 456 switch(pSettings->header) |
| 457 { | |
| 458 case 0xFFFF0000: | |
| 459 case 0xFFFF0001: | |
| 460 case 0xFFFF0002: | |
| 461 case 0xFFFF0003: | |
| 462 case 0xFFFF0004: | |
| 463 case 0xFFFF0005: | |
| 464 pSettings->ppo2sensors_deactivated = pStandard->ppo2sensors_deactivated; | |
| 465 pSettings->tX_colorscheme = pStandard->tX_colorscheme; | |
| 466 pSettings->tX_userselectedLeftLowerCornerPrimary = pStandard->tX_userselectedLeftLowerCornerPrimary; | |
| 467 pSettings->tX_userselectedLeftLowerCornerTimeout = pStandard->tX_userselectedLeftLowerCornerTimeout; | |
| 468 pSettings->tX_customViewPrimary = pStandard->tX_customViewPrimary; | |
| 469 pSettings->tX_customViewTimeout = pStandard->tX_customViewTimeout; | |
| 470 // no break | |
| 471 case 0xFFFF0006: | |
| 472 pSettings->timeoutEnterButtonSelectDive = pStandard->timeoutEnterButtonSelectDive; | |
| 473 pSettings->ButtonResponsiveness[0] = pStandard->ButtonResponsiveness[0]; | |
| 474 pSettings->ButtonResponsiveness[1] = pStandard->ButtonResponsiveness[1]; | |
| 475 pSettings->ButtonResponsiveness[2] = pStandard->ButtonResponsiveness[2]; | |
| 476 pSettings->ButtonResponsiveness[3] = pStandard->ButtonResponsiveness[3]; | |
| 477 pSettings->timeoutSurfacemode = pStandard->timeoutSurfacemode; | |
| 478 pSettings->timeoutMenuSurface = pStandard->timeoutMenuSurface; | |
| 479 pSettings->timeoutMenuDive = pStandard->timeoutMenuDive; | |
| 480 pSettings->timeoutMenuEdit = pStandard->timeoutMenuEdit; | |
| 481 pSettings->timeoutInfo = pStandard->timeoutInfo; | |
| 482 pSettings->timeoutInfoCompass = pStandard->timeoutInfoCompass; | |
| 483 pSettings->timeoutDiveReachedZeroDepth = pStandard->timeoutDiveReachedZeroDepth; | |
| 484 pSettings->divetimeToCreateLogbook = pStandard->divetimeToCreateLogbook; | |
| 485 pSettings->safetystopDuration = pStandard->safetystopDuration; // change from on/off to minutes | |
| 486 // no break | |
| 487 case 0xFFFF0007: | |
| 488 case 0xFFFF0008: | |
| 489 pSettings->alwaysShowPPO2 = pStandard->alwaysShowPPO2; | |
| 490 pSettings->logbookOffset = pStandard->logbookOffset; | |
| 491 // no break | |
| 492 case 0xFFFF0009: | |
| 493 pSettings->extraDisplay = pStandard->extraDisplay; | |
| 494 // no break | |
| 495 case 0xFFFF000A: | |
| 496 pSettings->display_toogle_desc = pStandard->display_toogle_desc; | |
| 497 // no break | |
| 498 case 0xFFFF000B: | |
| 499 pSettings->offsetPressure_mbar = pStandard->offsetPressure_mbar; | |
| 500 pSettings->offsetTemperature_centigrad = pStandard->offsetTemperature_centigrad; | |
| 501 pSettings->gasConsumption_travel_l_min = pStandard->gasConsumption_travel_l_min; | |
| 502 pSettings->gasConsumption_bottom_l_min = pStandard->gasConsumption_bottom_l_min; | |
| 503 pSettings->gasConsumption_deco_l_min = pStandard->gasConsumption_deco_l_min; | |
| 504 // no break | |
| 505 case 0xFFFF000C: | |
|
994
bad5561c0c59
Fix a compilation error occurring on non-Windows platforms, caused by incorrect case in '#include' file names.
heinrichsweikamp
parents:
993
diff
changeset
|
506 strncpy(pSettings->customtext, " hwOS 4\n\r" " welcome\n\r", sizeof(pSettings->customtext)); |
| 38 | 507 // no break |
| 508 case 0xFFFF000D: // nothing to do from 0xFFFF000D to 0xFFFF000E, just about header :-) | |
| 509 case 0xFFFF000E: | |
| 510 pSettings->debugModeOnStart = 0; | |
| 511 // no break | |
| 512 case 0xFFFF000F: | |
| 513 pSettings->compassBearing = 0; | |
| 514 // no break | |
| 515 case 0xFFFF0011: | |
| 516 pSettings->lastKnownBatteryPercentage = 0; | |
| 517 // no break | |
| 518 case 0xFFFF0012: | |
| 519 pSettings->buttonBalance[0] = 3; | |
| 520 pSettings->buttonBalance[1] = 3; | |
| 521 pSettings->buttonBalance[2] = 3; | |
| 522 // no break | |
| 523 case 0xFFFF0013: | |
| 524 case 0xFFFF0014: | |
| 525 pSettings->timeoutSurfacemodeWithSensors = pStandard->timeoutSurfacemodeWithSensors; | |
| 526 // no break | |
| 527 case 0xFFFF0015: | |
| 528 pSettings->ButtonResponsiveness[3] = pStandard->ButtonResponsiveness[3]; | |
| 529 settingsHelperButtonSens_keepPercentageValues(settingsHelperButtonSens_translate_hwOS_values_to_percentage(pSettings->ButtonResponsiveness[3]), pSettings->ButtonResponsiveness); | |
| 530 pSettings->VPM_model = 0; | |
| 531 pSettings->GF_model = 0; | |
| 532 // no break | |
| 533 case 0xFFFF0016: | |
| 534 pSettings->FactoryButtonBase = pStandard->FactoryButtonBase; | |
| 535 pSettings->FactoryButtonBalance[0] = pStandard->FactoryButtonBalance[0]; | |
| 536 pSettings->FactoryButtonBalance[1] = pStandard->FactoryButtonBalance[1]; | |
| 537 pSettings->FactoryButtonBalance[2] = pStandard->FactoryButtonBalance[2]; | |
| 538 // no break | |
|
111
38785aa95837
Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents:
75
diff
changeset
|
539 case 0xFFFF0017: |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
540 setFlipDisplay(0); |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
541 // no break |
|
210
b2a9e9b02df0
New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents:
172
diff
changeset
|
542 case 0xFFFF0018: |
|
b2a9e9b02df0
New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents:
172
diff
changeset
|
543 pSettings->cv_configuration = 0xFFFFFFFF; |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
544 pSettings->cv_configuration &= ~(1 << CVIEW_sensors | 1 << CVIEW_sensors_mV | 1 << CVIEW_Timer); |
|
210
b2a9e9b02df0
New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents:
172
diff
changeset
|
545 // no break |
|
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:
324
diff
changeset
|
546 case 0xFFFF0019: |
|
375
4bb5ceebfaf9
Use Enum values for initialization and setting check:
ideenmodellierer
parents:
372
diff
changeset
|
547 pSettings->MotionDetection = MOTION_DETECT_OFF; |
|
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:
324
diff
changeset
|
548 // no break |
|
498
4811f3dfaa52
Added dew parameter to enable selection of customer BigFont screens to be displayed
Ideenmodellierer
parents:
492
diff
changeset
|
549 case 0xFFFF001A: |
| 505 | 550 /* deactivate new views => to be activated by customer */ |
|
498
4811f3dfaa52
Added dew parameter to enable selection of customer BigFont screens to be displayed
Ideenmodellierer
parents:
492
diff
changeset
|
551 pSettings->cv_config_BigScreen = 0xFFFFFFFF; |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
552 pSettings->cv_config_BigScreen &= 1 << (CVIEW_T3_Navigation + LEGACY_T3_START_ID_PRE_TIMER); |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
553 pSettings->cv_config_BigScreen &= 1 << (CVIEW_T3_DepthData + LEGACY_T3_START_ID_PRE_TIMER); |
|
498
4811f3dfaa52
Added dew parameter to enable selection of customer BigFont screens to be displayed
Ideenmodellierer
parents:
492
diff
changeset
|
554 // no break |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
533
diff
changeset
|
555 case 0xFFFF001B: |
|
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
556 pSettings->compassInertia = 0; /* no inertia */ |
|
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
557 pSettings->tX_customViewPrimaryBF = CVIEW_T3_Decostop; |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
558 pSettings->cv_config_BigScreen &= 1 << (CVIEW_T3_DecoTTS + LEGACY_T3_START_ID_PRE_TIMER); |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
533
diff
changeset
|
559 // no break |
| 546 | 560 case 0xFFFF001C: |
| 561 pSettings->viewPortMode = 0; | |
| 562 pSettings->viewRoll = 0; | |
| 563 pSettings->viewPitch = 0; | |
| 564 pSettings->viewYaw = 0; | |
| 565 // no break | |
|
560
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
566 case 0xFFFF001D: |
|
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
567 pSettings->ppo2sensors_source = O2_SENSOR_SOURCE_OPTIC; |
|
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
568 pSettings->ppo2sensors_calibCoeff[0] = 0.0; |
|
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
569 pSettings->ppo2sensors_calibCoeff[1] = 0.0; |
|
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
570 pSettings->ppo2sensors_calibCoeff[2] = 0.0; |
| 662 | 571 pSettings->amPMTime = 0; |
|
560
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
572 // no break |
| 662 | 573 case 0xFFFF001E: |
| 574 pSettings->autoSetpoint = 0; | |
| 710 | 575 pSettings->scrubTimerMax_Obsolete = 0; |
| 576 pSettings->scrubTimerCur_Obsolete = 0; | |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
577 pSettings->scrubTimerMode = SCRUB_TIMER_MINUTES; |
| 662 | 578 // no break |
| 579 case 0xFFFF001F: | |
| 580 pSettings->pscr_lung_ratio = 10; | |
| 581 pSettings->pscr_o2_drop = 4; | |
| 582 // no break | |
| 583 case 0xFFFF0020: | |
| 584 pSettings->co2_sensor_active = 0; | |
| 585 // no break; | |
| 687 | 586 case 0xFFFF0021: |
| 587 pSettings->ext_uart_protocol = 0; | |
| 588 // no break; | |
| 710 | 589 case 0xFFFF0022: |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
590 pSettings->scrubberActiveId = 0; |
| 710 | 591 pSettings->scrubberData[0].TimerCur = pSettings->scrubTimerCur_Obsolete; |
| 592 pSettings->scrubberData[0].TimerMax = pSettings->scrubTimerMax_Obsolete; | |
| 593 pSettings->scrubberData[0].lastDive.WeekDay = 0; | |
| 594 pSettings->scrubberData[0].lastDive.Month = 0; | |
| 595 pSettings->scrubberData[0].lastDive.Date = 0; | |
| 596 pSettings->scrubberData[0].lastDive.Year = 0; | |
| 597 | |
| 598 pSettings->scrubberData[1].TimerCur = 0; | |
| 599 pSettings->scrubberData[1].TimerMax = 0; | |
| 600 pSettings->scrubberData[1].lastDive.WeekDay = 0; | |
| 601 pSettings->scrubberData[1].lastDive.Month = 0; | |
| 602 pSettings->scrubberData[1].lastDive.Date = 0; | |
| 603 pSettings->scrubberData[1].lastDive.Year = 0; | |
| 604 // no break; | |
| 733 | 605 case 0xFFFF0023: pSettings->ext_sensor_map[0] = SENSOR_OPTIC; |
| 606 pSettings->ext_sensor_map[1] = SENSOR_OPTIC; | |
| 607 pSettings->ext_sensor_map[2] = SENSOR_OPTIC; | |
|
728
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
715
diff
changeset
|
608 pSettings->ext_sensor_map[3] = SENSOR_NONE; |
|
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
715
diff
changeset
|
609 pSettings->ext_sensor_map[4] = SENSOR_NONE; |
|
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
715
diff
changeset
|
610 // no break; |
|
740
5078da3845c0
Added button lock after wakeup in surface mode:
Ideenmodellierer
parents:
733
diff
changeset
|
611 case 0xFFFF0024: pSettings->buttonLockActive = 0; |
|
5078da3845c0
Added button lock after wakeup in surface mode:
Ideenmodellierer
parents:
733
diff
changeset
|
612 // no break; |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
768
diff
changeset
|
613 case 0xFFFF0025: |
|
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
768
diff
changeset
|
614 pSettings->compassDeclinationDeg = pStandard->compassDeclinationDeg; |
|
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
|
615 pSettings->delaySetpointLow = pStandard->delaySetpointLow; |
|
792
25103f5c7e29
Avoid a configuration warning after the firmware upgrade by disabling automatic setpoint switching. This makes sure the user's automatic setpoint configuration is not overwritten by the validity checks if the settings are not in the correct spots for the new configuration. Users will have to manually re-create the automatic setpoint switching configuration in the new format;
heinrichsweikamp
parents:
788
diff
changeset
|
616 // Disable auto setpoint to avoid a configuration warning being triggered by the new auto setpoint validation |
|
25103f5c7e29
Avoid a configuration warning after the firmware upgrade by disabling automatic setpoint switching. This makes sure the user's automatic setpoint configuration is not overwritten by the validity checks if the settings are not in the correct spots for the new configuration. Users will have to manually re-create the automatic setpoint switching configuration in the new format;
heinrichsweikamp
parents:
788
diff
changeset
|
617 // This ensures that users don't lose setpoint information if it is not in the right spot for the new configuration |
|
25103f5c7e29
Avoid a configuration warning after the firmware upgrade by disabling automatic setpoint switching. This makes sure the user's automatic setpoint configuration is not overwritten by the validity checks if the settings are not in the correct spots for the new configuration. Users will have to manually re-create the automatic setpoint switching configuration in the new format;
heinrichsweikamp
parents:
788
diff
changeset
|
618 pSettings->autoSetpoint = false; |
|
805
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
801
diff
changeset
|
619 |
|
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
801
diff
changeset
|
620 pSettings->timerDurationS = pStandard->timerDurationS; |
|
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
801
diff
changeset
|
621 |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
768
diff
changeset
|
622 // no break; |
| 796 | 623 case 0xFFFF0026: |
| 624 pSettings->ext_sensor_map[0] = pSettings->ext_sensor_map_Obsolete[0]; | |
| 625 pSettings->ext_sensor_map[1] = pSettings->ext_sensor_map_Obsolete[1]; | |
| 626 pSettings->ext_sensor_map[2] = pSettings->ext_sensor_map_Obsolete[2]; | |
| 627 pSettings->ext_sensor_map[3] = pSettings->ext_sensor_map_Obsolete[3]; | |
| 628 pSettings->ext_sensor_map[4] = pSettings->ext_sensor_map_Obsolete[4]; | |
| 629 pSettings->ext_sensor_map[5] = SENSOR_NONE; | |
| 630 pSettings->ext_sensor_map[6] = SENSOR_NONE; | |
| 631 pSettings->ext_sensor_map[7] = SENSOR_NONE; | |
|
805
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
801
diff
changeset
|
632 |
|
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
801
diff
changeset
|
633 // no break; |
| 820 | 634 case 0xFFFF0027: |
| 635 tmp = pSettings->cv_config_BigScreen & 0x00000007; /* position of first three view is keeps the same */ | |
| 636 /* Identify from which data version was in use before the update */ | |
| 637 if(pSettings->tX_customViewPrimaryBF == LEGACY_CV_END_POST_TIMER) /* data version after introduction of timer (ID shift problem) */ | |
| 638 { | |
| 639 pSettings->tX_customViewPrimaryBF = CVIEW_T3_Decostop; | |
| 640 } | |
| 641 else | |
| 642 { | |
| 643 if(pSettings->tX_customViewPrimaryBF >= 3) | |
| 644 { | |
| 645 pSettings->tX_customViewPrimaryBF -= LEGACY_T3_START_ID_PRE_TIMER - 3; | |
| 646 } | |
| 647 } | |
| 648 pSettings->cv_config_BigScreen = pSettings->cv_config_BigScreen >> (LEGACY_T3_START_ID_PRE_TIMER - 3); | |
| 649 pSettings->cv_config_BigScreen &= ~0x00000007; /* just to be sure: clear lower three bits */ | |
| 650 pSettings->cv_config_BigScreen |= tmp; | |
|
830
b7d93ff6b3b2
Added selection if an active gas shall be used for deco calculation or not:
Ideenmodellierer
parents:
820
diff
changeset
|
651 // no break; |
| 973 | 652 case 0xFFFF0028: |
| 820 | 653 // no break; |
|
834
2a8af51ab04d
Added event based display changes for big font view:
Ideenmodellierer
parents:
830
diff
changeset
|
654 case 0xFFFF0029: |
| 1027 | 655 pSettings->cvAutofocus = 0; |
|
834
2a8af51ab04d
Added event based display changes for big font view:
Ideenmodellierer
parents:
830
diff
changeset
|
656 // no break; |
| 882 | 657 case 0xFFFF002A: |
| 1027 | 658 pSettings->slowExitTime = 0; |
| 882 | 659 // no break; |
| 949 | 660 case 0xFFFF002B: |
| 1027 | 661 pSettings->timeZone.hours = 0; |
| 662 pSettings->timeZone.minutes = 0; | |
| 663 pSettings->warningBuzzer = 0; | |
| 664 // no break; | |
| 665 case 0xFFFF002C: | |
| 666 sprintf((char*)pSettings->profileName[0],"STANDARD"); | |
| 667 sprintf((char*)pSettings->profileName[1],"OC_TX___"); | |
| 668 sprintf((char*)pSettings->profileName[2],"MCCR____"); | |
| 669 sprintf((char*)pSettings->profileName[3],"ECCR____"); | |
| 670 pSettings->activeProfile = 0; | |
| 1050 | 671 // no break; |
| 672 case 0xFFFF002D: | |
| 673 if(pSettings->tX_userselectedLeftLowerCornerPrimary > LLC_GF) /* GF_Surf was added behind => shift ID of views */ | |
| 674 { | |
| 675 pSettings->tX_userselectedLeftLowerCornerPrimary++; | |
| 676 } | |
|
1082
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
677 // no break; |
|
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
678 case 0xFFFF002E: pSettings->hudFunction[0] = HUD_FCT_NONE; /* todo: define default setup */ |
|
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
679 pSettings->hudFunction[1] = HUD_FCT_NONE; |
|
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
680 pSettings->hudFunction[2] = HUD_FCT_NONE; |
|
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
681 pSettings->hudFunction[3] = HUD_FCT_NONE; |
|
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
682 pSettings->hudFunction[4] = HUD_FCT_NONE; |
|
1aa45000f92c
Added configuration menu for HUD functions:
Ideenmodellierer
parents:
1068
diff
changeset
|
683 pSettings->hudFunction[5] = HUD_FCT_NONE; |
| 949 | 684 // no break; |
| 38 | 685 default: |
|
210
b2a9e9b02df0
New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents:
172
diff
changeset
|
686 pSettings->header = pStandard->header; |
| 38 | 687 break; // no break before!! |
| 688 } | |
| 689 } | |
| 690 | |
| 691 | |
| 692 uint8_t newFirmwareVersionCheckViaSettings(void) | |
| 693 { | |
| 694 SSettings* pSettings = settingsGetPointer(); | |
| 695 | |
| 696 if(pSettings->header < 0xFFFF0014) // for the versions without firmwareVersion[] | |
| 697 return 1; | |
| 698 | |
| 699 if(pSettings->firmwareVersion[0] != firmware_FirmwareData.versionFirst) | |
| 700 return 1; | |
| 701 if(pSettings->firmwareVersion[1] != firmware_FirmwareData.versionSecond) | |
| 702 return 1; | |
| 703 if(pSettings->firmwareVersion[2] != firmware_FirmwareData.versionThird) | |
| 704 return 1; | |
| 705 if(pSettings->firmwareVersion[3] != firmware_FirmwareData.versionBeta) | |
| 706 return 1; | |
| 707 | |
| 708 return 0; | |
| 709 } | |
| 710 | |
| 711 | |
|
765
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
712 void set_settings_button_to_factory_with_individual_buttonBalance(void) |
| 38 | 713 { |
|
765
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
714 bool factoryBalanceSettingsValid = true; |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
715 unsigned i = 0; |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
716 while (factoryBalanceSettingsValid && i < 3) { |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
717 if (Settings.FactoryButtonBalance[i] < 2 || Settings.FactoryButtonBalance[i] > 5) { |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
718 factoryBalanceSettingsValid = false; |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
719 } |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
720 |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
721 i++; |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
722 } |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
723 if (factoryBalanceSettingsValid) { |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
724 for (i = 0; i < 3; i++) { |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
725 Settings.buttonBalance[i] = Settings.FactoryButtonBalance[i]; |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
726 } |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
727 } |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
728 |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
729 uint8_t buttonResponsiveness = Settings.FactoryButtonBase; |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
730 if (buttonResponsiveness < 70 || buttonResponsiveness > 110) { |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
731 buttonResponsiveness = SettingsStandard.ButtonResponsiveness[3]; |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
732 } |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
733 |
|
da8126d5ea9f
After a firmware update, use the factory settings for button sensitivity if these exist, the default settings otherwise.
heinrichsweikamp
parents:
762
diff
changeset
|
734 settingsHelperButtonSens_keepPercentageValues(buttonResponsiveness, settingsGetPointer()->ButtonResponsiveness); |
| 38 | 735 } |
| 736 | |
| 737 | |
|
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
|
738 bool checkAndFixSetpointSettings(void) |
|
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
|
739 { |
|
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
|
740 SSettings *settings = settingsGetPointer(); |
|
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
|
741 |
|
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
|
742 bool fixed = false; |
|
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
|
743 if (settings->autoSetpoint) { |
|
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
|
744 SSetpointLine *setpointLow = &settings->setpoint[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
|
745 if (setpointLow->setpoint_cbar >= 100) { |
|
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
|
746 setpointLow->setpoint_cbar = 70; |
|
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
|
747 |
|
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
|
748 fixed = true; |
|
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
|
749 } |
|
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
|
750 if (setpointLow->depth_meter == 0 || setpointLow->depth_meter > 100) { |
|
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
|
751 setpointLow->depth_meter = 2; |
|
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
|
752 |
|
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
|
753 fixed = true; |
|
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
|
754 } |
|
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
|
755 SSetpointLine *setpointHigh = &settings->setpoint[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
|
756 if (setpointHigh->setpoint_cbar <= setpointLow->setpoint_cbar) { |
|
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
|
757 setpointHigh->setpoint_cbar = 130; |
|
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
|
758 |
|
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
|
759 fixed = true; |
|
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
|
760 } |
|
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
|
761 if (setpointHigh->depth_meter <= setpointLow->depth_meter) { |
|
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
|
762 setpointHigh->depth_meter = setpointLow->depth_meter + 6; |
|
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
|
763 |
|
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
|
764 fixed = true; |
|
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
|
765 } |
|
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
|
766 |
|
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
|
767 SSetpointLine *setpointDeco = &settings->setpoint[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
|
768 if (setpointDeco->note.ub.active) { |
|
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
|
769 if (setpointDeco->setpoint_cbar == setpointHigh->setpoint_cbar || setpointDeco->setpoint_cbar == setpointLow->setpoint_cbar) { |
|
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
|
770 setpointDeco->setpoint_cbar = 10 * (setpointHigh->setpoint_cbar / 10) - 10; |
|
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
|
771 if (setpointDeco->setpoint_cbar == setpointLow->setpoint_cbar) { |
|
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
|
772 setpointDeco->setpoint_cbar += 5; |
|
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
|
773 } |
|
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
|
774 |
|
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
|
775 fixed = true; |
|
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
|
776 } |
|
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
|
777 } |
|
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
|
778 } |
|
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
|
779 |
|
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
|
780 return fixed; |
|
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
|
781 } |
|
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
|
782 |
| 820 | 783 static void setFirstCorrection(uint8_t Id) |
| 784 { | |
| 785 if(SettingsStatus.FirstCorrection == 0xFF) | |
| 786 { | |
| 787 SettingsStatus.FirstCorrection = Id; | |
| 788 } | |
| 789 } | |
| 790 | |
| 791 void get_CorrectionStatus(SSettingsStatus* Status) | |
| 792 { | |
| 793 if(Status != NULL) | |
| 794 { | |
| 795 memcpy(Status, &SettingsStatus,2); | |
| 796 } | |
| 797 } | |
|
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
|
798 |
| 1027 | 799 uint8_t check_and_correct_settings(uint8_t whichSettings) |
| 38 | 800 { |
| 801 uint32_t corrections = 0; | |
| 802 uint8_t firstGasFoundOC = 0; | |
| 803 uint8_t firstGasFoundCCR = 0; | |
| 820 | 804 uint8_t parameterId = 0; |
| 38 | 805 |
| 662 | 806 |
| 807 settingsWarning = 0; /* reset warning indicator */ | |
| 820 | 808 SettingsStatus.FirstCorrection = 0xFF; |
| 662 | 809 |
| 1027 | 810 pSettings = settingsGetPointer(); |
| 811 | |
| 812 switch(whichSettings) | |
| 813 { | |
| 814 default: | |
| 815 case EF_SETTINGS: | |
| 816 break; | |
| 817 case EF_PROFILE0: pSettings = profileGetPointer(0); | |
| 818 break; | |
| 819 case EF_PROFILE1: pSettings = profileGetPointer(1); | |
| 820 break; | |
| 821 case EF_PROFILE2: pSettings = profileGetPointer(2); | |
| 822 break; | |
| 823 case EF_PROFILE3: pSettings = profileGetPointer(3); | |
| 824 break; | |
| 825 } | |
| 826 | |
| 827 | |
| 828 | |
| 38 | 829 /* uint32_t header; |
| 830 */ | |
| 831 | |
| 832 /* uint8_t warning_blink_dsec; 1/10 seconds | |
| 833 */ | |
| 1027 | 834 if((pSettings->warning_blink_dsec < 1) || (pSettings->warning_blink_dsec > 100)) |
| 38 | 835 { |
| 1027 | 836 pSettings->warning_blink_dsec = SettingsStandard.warning_blink_dsec; |
| 38 | 837 corrections++; |
| 820 | 838 setFirstCorrection(parameterId); |
| 38 | 839 } |
| 997 | 840 parameterId++; /* 1 */ |
| 38 | 841 /* uint8_t lastDiveLogId; |
| 842 */ | |
| 843 | |
| 844 /* uint32_t logFlashNextSampleStartAddress; | |
| 845 */ | |
| 1027 | 846 if((pSettings->logFlashNextSampleStartAddress < SAMPLESTART) || (pSettings->logFlashNextSampleStartAddress > SAMPLESTOP)) |
| 38 | 847 { |
| 1027 | 848 pSettings->logFlashNextSampleStartAddress = SAMPLESTART; |
| 38 | 849 corrections++; |
| 820 | 850 setFirstCorrection(parameterId); |
| 38 | 851 } |
| 997 | 852 parameterId++; /* 2 */ |
| 38 | 853 |
| 854 /* uint8_t dive_mode; has to before the gases | |
| 855 */ | |
| 1027 | 856 if( (pSettings->dive_mode != DIVEMODE_OC) && |
| 857 (pSettings->dive_mode != DIVEMODE_CCR) && | |
| 858 (pSettings->dive_mode != DIVEMODE_Gauge) && | |
| 859 (pSettings->dive_mode != DIVEMODE_Apnea) && | |
| 860 (pSettings->dive_mode != DIVEMODE_PSCR)) | |
| 38 | 861 { |
| 1027 | 862 pSettings->dive_mode = DIVEMODE_OC; |
| 38 | 863 corrections++; |
| 820 | 864 setFirstCorrection(parameterId); |
| 38 | 865 } |
| 997 | 866 parameterId++;/* 3 */ |
| 38 | 867 |
| 868 /* SGasLine gas[1 + (2*NUM_GASES)]; | |
| 869 */ | |
| 870 for(int i=1; i<=2*NUM_GASES;i++) | |
| 871 { | |
| 1027 | 872 if(pSettings->gas[i].oxygen_percentage < 4) |
| 38 | 873 { |
| 1027 | 874 pSettings->gas[i].oxygen_percentage = 4; |
| 38 | 875 corrections++; |
| 820 | 876 setFirstCorrection(parameterId); |
| 38 | 877 } |
| 1027 | 878 if(pSettings->gas[i].oxygen_percentage > 100) |
| 38 | 879 { |
| 1027 | 880 pSettings->gas[i].oxygen_percentage = 100; |
| 38 | 881 corrections++; |
| 820 | 882 setFirstCorrection(parameterId); |
| 38 | 883 } |
| 1027 | 884 if((pSettings->gas[i].oxygen_percentage + pSettings->gas[i].helium_percentage) > 100) |
| 38 | 885 { |
| 1027 | 886 pSettings->gas[i].helium_percentage = 100 - pSettings->gas[i].oxygen_percentage; |
| 38 | 887 corrections++; |
| 820 | 888 setFirstCorrection(parameterId); |
| 38 | 889 } |
| 1027 | 890 if(pSettings->gas[i].note.ub.deco) |
| 38 | 891 { |
| 1027 | 892 if(pSettings->gas[i].note.ub.active != 1) |
| 38 | 893 { |
| 1027 | 894 pSettings->gas[i].note.ub.active = 1; |
| 38 | 895 corrections++; |
| 820 | 896 setFirstCorrection(parameterId); |
| 38 | 897 } |
| 1027 | 898 if(pSettings->gas[i].note.ub.travel == 1) |
| 38 | 899 { |
| 1027 | 900 pSettings->gas[i].note.ub.travel = 0; |
| 38 | 901 corrections++; |
| 820 | 902 setFirstCorrection(parameterId); |
| 38 | 903 } |
| 904 } | |
| 1027 | 905 if(pSettings->gas[i].note.ub.travel) |
| 38 | 906 { |
| 1027 | 907 if(pSettings->gas[i].note.ub.active != 1) |
| 38 | 908 { |
| 1027 | 909 pSettings->gas[i].note.ub.active = 1; |
| 38 | 910 corrections++; |
| 820 | 911 setFirstCorrection(parameterId); |
| 38 | 912 } |
| 1027 | 913 if(pSettings->gas[i].note.ub.deco == 1) |
| 38 | 914 { |
| 1027 | 915 pSettings->gas[i].note.ub.deco = 0; |
| 38 | 916 corrections++; |
| 820 | 917 setFirstCorrection(parameterId); |
| 38 | 918 } |
| 919 } | |
| 1027 | 920 if(pSettings->gas[i].note.ub.first) |
| 38 | 921 { |
| 1027 | 922 if(pSettings->gas[i].note.ub.active != 1) |
| 38 | 923 { |
| 1027 | 924 pSettings->gas[i].note.ub.active = 1; |
| 38 | 925 corrections++; |
| 820 | 926 setFirstCorrection(parameterId); |
| 38 | 927 } |
| 1027 | 928 if(pSettings->gas[i].note.ub.travel == 1) |
| 38 | 929 { |
| 1027 | 930 pSettings->gas[i].note.ub.travel = 0; |
| 38 | 931 corrections++; |
| 820 | 932 setFirstCorrection(parameterId); |
| 38 | 933 } |
| 1027 | 934 if(pSettings->gas[i].note.ub.deco == 1) |
| 38 | 935 { |
| 1027 | 936 pSettings->gas[i].note.ub.deco = 0; |
| 38 | 937 corrections++; |
| 820 | 938 setFirstCorrection(parameterId); |
| 38 | 939 } |
| 940 if((i<=NUM_GASES) && (!firstGasFoundOC)) | |
| 941 firstGasFoundOC = 1; | |
| 942 else | |
| 943 if((i>NUM_GASES) && (!firstGasFoundCCR)) | |
| 944 firstGasFoundCCR = 1; | |
| 945 else | |
| 1027 | 946 pSettings->gas[i].note.ub.first = 0; |
| 38 | 947 } |
| 1027 | 948 if(pSettings->gas[i].bottle_size_liter > 40) |
| 38 | 949 { |
| 1027 | 950 pSettings->gas[i].bottle_size_liter = 40; |
| 38 | 951 corrections++; |
| 820 | 952 setFirstCorrection(parameterId); |
| 38 | 953 } |
| 1027 | 954 if(pSettings->gas[i].depth_meter > 250) |
| 38 | 955 { |
| 1027 | 956 pSettings->gas[i].depth_meter = 250; |
| 38 | 957 corrections++; |
| 820 | 958 setFirstCorrection(parameterId); |
| 38 | 959 } |
| 1027 | 960 if(pSettings->gas[i].depth_meter_travel > 250) |
| 38 | 961 { |
| 1027 | 962 pSettings->gas[i].depth_meter_travel = 250; |
| 38 | 963 corrections++; |
| 820 | 964 setFirstCorrection(parameterId); |
| 38 | 965 } |
| 1027 | 966 /*if(pSettings->gas[i].note.ub.senderCode) |
| 38 | 967 { |
| 968 } | |
| 1027 | 969 if(pSettings->gas[i].bottle_wireless_id) |
| 38 | 970 { |
| 971 } | |
| 972 */ | |
| 973 } // for(int i=1; i<=2*NUM_GASES;i++) | |
| 997 | 974 parameterId++; /* 4 */ |
| 38 | 975 if(!firstGasFoundOC) |
| 976 { | |
| 1027 | 977 pSettings->gas[1].note.ub.active = 1; |
| 978 pSettings->gas[1].note.ub.first = 1; | |
| 979 pSettings->gas[1].note.ub.travel = 0; | |
| 980 pSettings->gas[1].note.ub.deco = 0; | |
| 662 | 981 corrections++; |
| 820 | 982 setFirstCorrection(parameterId); |
| 38 | 983 } |
| 997 | 984 parameterId++; /* 5 */ |
| 38 | 985 if(!firstGasFoundCCR) |
| 986 { | |
| 1027 | 987 pSettings->gas[1 + NUM_GASES].note.ub.active = 1; |
| 988 pSettings->gas[1 + NUM_GASES].note.ub.first = 1; | |
| 989 pSettings->gas[1 + NUM_GASES].note.ub.travel = 0; | |
| 990 pSettings->gas[1 + NUM_GASES].note.ub.deco = 0; | |
| 662 | 991 corrections++; |
| 820 | 992 setFirstCorrection(parameterId); |
| 38 | 993 } |
| 997 | 994 parameterId++; /* 6 */ |
| 38 | 995 /* SSetpointLine setpoint[1 + NUM_GASES]; |
| 996 */ | |
| 997 for(int i=1; i<=NUM_GASES;i++) | |
| 998 { | |
| 1027 | 999 if(pSettings->setpoint[i].setpoint_cbar < MIN_PPO2_SP_CBAR) |
| 38 | 1000 { |
| 1027 | 1001 pSettings->setpoint[i].setpoint_cbar = MIN_PPO2_SP_CBAR; |
| 38 | 1002 corrections++; |
| 820 | 1003 setFirstCorrection(parameterId); |
| 38 | 1004 } |
| 1027 | 1005 if(pSettings->setpoint[i].setpoint_cbar > 160) |
| 38 | 1006 { |
| 1027 | 1007 pSettings->setpoint[i].setpoint_cbar = 160; |
| 38 | 1008 corrections++; |
| 820 | 1009 setFirstCorrection(parameterId); |
| 38 | 1010 } |
| 1027 | 1011 if(pSettings->setpoint[i].depth_meter > 250) |
| 38 | 1012 { |
| 1027 | 1013 pSettings->setpoint[i].depth_meter = 250; |
| 38 | 1014 corrections++; |
| 820 | 1015 setFirstCorrection(parameterId); |
| 38 | 1016 } |
| 1017 } // for(int i=1; i<=NUM_GASES;i++) | |
| 997 | 1018 parameterId++; /* 7 */ |
|
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
|
1019 if (checkAndFixSetpointSettings()) { |
|
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
|
1020 corrections++; |
| 820 | 1021 setFirstCorrection(parameterId); |
|
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
|
1022 } |
| 997 | 1023 parameterId++; /* 8 */ |
| 38 | 1024 /* uint8_t CCR_Mode; |
| 1025 */ | |
| 1027 | 1026 if( (pSettings->CCR_Mode != CCRMODE_Sensors) && |
| 1027 (pSettings->CCR_Mode != CCRMODE_Simulation) && | |
| 1028 (pSettings->CCR_Mode != CCRMODE_FixedSetpoint)) | |
| 38 | 1029 { |
| 1027 | 1030 pSettings->CCR_Mode = CCRMODE_FixedSetpoint; |
| 38 | 1031 corrections++; |
| 820 | 1032 setFirstCorrection(parameterId); |
| 38 | 1033 } |
| 997 | 1034 parameterId++; /* 9 */ |
| 38 | 1035 /* split2x4_Type deco_type; |
| 1036 */ | |
| 1027 | 1037 if( (pSettings->deco_type.ub.standard != GF_MODE) && |
| 1038 (pSettings->deco_type.ub.standard != VPM_MODE)) | |
| 38 | 1039 { |
| 1027 | 1040 pSettings->deco_type.ub.standard = VPM_MODE; |
| 38 | 1041 corrections++; |
| 820 | 1042 setFirstCorrection(parameterId); |
| 38 | 1043 } |
| 997 | 1044 parameterId++; /* 10 */ |
| 1027 | 1045 if(pSettings->deco_type.ub.alternative != GF_MODE) |
| 38 | 1046 { |
| 1027 | 1047 pSettings->deco_type.ub.alternative = GF_MODE; |
| 38 | 1048 corrections++; |
| 820 | 1049 setFirstCorrection(parameterId); |
| 38 | 1050 } |
| 997 | 1051 parameterId++; /* 11 */ |
| 38 | 1052 /* uint8_t ppO2_max_deco; |
| 1053 */ | |
| 1027 | 1054 if(pSettings->ppO2_max_deco > 190) |
| 38 | 1055 { |
| 1027 | 1056 pSettings->ppO2_max_deco = 190; |
| 38 | 1057 corrections++; |
| 820 | 1058 setFirstCorrection(parameterId); |
| 38 | 1059 } |
| 997 | 1060 parameterId++; /* 12 */ |
| 1027 | 1061 if(pSettings->ppO2_max_deco < 100) |
| 38 | 1062 { |
| 1027 | 1063 pSettings->ppO2_max_deco = 100; |
| 38 | 1064 corrections++; |
| 820 | 1065 setFirstCorrection(parameterId); |
| 38 | 1066 } |
| 997 | 1067 parameterId++; /* 13 */ |
| 38 | 1068 |
| 1069 /* uint8_t ppO2_max_std; | |
| 1070 */ | |
| 1027 | 1071 if(pSettings->ppO2_max_std > 190) |
| 38 | 1072 { |
| 1027 | 1073 pSettings->ppO2_max_std = 190; |
| 38 | 1074 corrections++; |
| 820 | 1075 setFirstCorrection(parameterId); |
| 38 | 1076 } |
| 997 | 1077 parameterId++; /* 14 */ |
| 1027 | 1078 if(pSettings->ppO2_max_std < 100) |
| 38 | 1079 { |
| 1027 | 1080 pSettings->ppO2_max_std = 100; |
| 38 | 1081 corrections++; |
| 820 | 1082 setFirstCorrection(parameterId); |
| 38 | 1083 } |
| 997 | 1084 parameterId++; /* 15 */ |
| 38 | 1085 /* uint8_t ppO2_min; |
| 1086 */ | |
| 1027 | 1087 if(pSettings->ppO2_min != 15) |
| 38 | 1088 { |
| 1027 | 1089 pSettings->ppO2_min = 15; |
| 38 | 1090 corrections++; |
| 820 | 1091 setFirstCorrection(parameterId); |
| 38 | 1092 } |
| 997 | 1093 parameterId++; /* 16 */ |
| 38 | 1094 /* uint8_t CNS_max; |
| 1095 */ | |
| 1027 | 1096 if(pSettings->CNS_max != 90) |
| 38 | 1097 { |
| 1027 | 1098 pSettings->CNS_max = 90; |
| 38 | 1099 corrections++; |
| 820 | 1100 setFirstCorrection(parameterId); |
| 38 | 1101 } |
| 997 | 1102 parameterId++; /* 17 */ |
| 38 | 1103 /* uint8_t ascent_MeterPerMinute_max; |
| 1104 */ | |
| 1027 | 1105 if(pSettings->ascent_MeterPerMinute_max != 30) |
| 38 | 1106 { |
| 1027 | 1107 pSettings->ascent_MeterPerMinute_max = 30; |
| 38 | 1108 corrections++; |
| 820 | 1109 setFirstCorrection(parameterId); |
| 38 | 1110 } |
| 997 | 1111 parameterId++; /* 18 */ |
| 38 | 1112 /* uint8_t ascent_MeterPerMinute_showGraph; |
| 1113 */ | |
| 1027 | 1114 if(pSettings->ascent_MeterPerMinute_showGraph != 30) |
| 38 | 1115 { |
| 1027 | 1116 pSettings->ascent_MeterPerMinute_showGraph = 30; |
| 38 | 1117 corrections++; |
| 820 | 1118 setFirstCorrection(parameterId); |
| 38 | 1119 } |
| 997 | 1120 parameterId++; /* 19 */ |
| 38 | 1121 /* uint8_t future_TTS; |
| 1122 */ | |
| 1027 | 1123 if(pSettings->future_TTS > 15) |
| 38 | 1124 { |
| 1027 | 1125 pSettings->future_TTS = 15; |
| 38 | 1126 corrections++; |
| 820 | 1127 setFirstCorrection(parameterId); |
| 38 | 1128 } |
| 997 | 1129 parameterId++; /* 20 */ |
| 38 | 1130 /* uint8_t GF_high; |
| 1131 */ | |
| 1027 | 1132 if(pSettings->GF_high > 99) |
| 38 | 1133 { |
| 1027 | 1134 pSettings->GF_high = 99; |
| 38 | 1135 corrections++; |
| 820 | 1136 setFirstCorrection(parameterId); |
| 38 | 1137 } |
| 997 | 1138 parameterId++; /* 21 */ |
| 1027 | 1139 if(pSettings->GF_high < 45) |
| 38 | 1140 { |
| 1027 | 1141 pSettings->GF_high = 45; |
| 38 | 1142 corrections++; |
| 820 | 1143 setFirstCorrection(parameterId); |
| 38 | 1144 } |
| 997 | 1145 parameterId++; /* 22 */ |
| 38 | 1146 /* uint8_t GF_low; |
| 1147 */ | |
| 1027 | 1148 if(pSettings->GF_low > 99) |
| 38 | 1149 { |
| 1027 | 1150 pSettings->GF_low = 99; |
| 38 | 1151 corrections++; |
| 820 | 1152 setFirstCorrection(parameterId); |
| 38 | 1153 } |
| 997 | 1154 parameterId++; /* 23 */ |
| 1027 | 1155 if(pSettings->GF_low < 10) |
| 38 | 1156 { |
| 1027 | 1157 pSettings->GF_low = 10; |
| 38 | 1158 corrections++; |
| 820 | 1159 setFirstCorrection(parameterId); |
| 38 | 1160 } |
| 997 | 1161 parameterId++; /* 24 */ |
| 1027 | 1162 if(pSettings->GF_low > pSettings->GF_high) |
| 38 | 1163 { |
| 1027 | 1164 pSettings->GF_low = pSettings->GF_high; |
| 38 | 1165 corrections++; |
| 820 | 1166 setFirstCorrection(parameterId); |
| 38 | 1167 } |
| 997 | 1168 parameterId++; /* 25 */ |
| 38 | 1169 /* uint8_t aGF_high; |
| 1170 */ | |
| 1027 | 1171 if(pSettings->aGF_high > 99) |
| 38 | 1172 { |
| 1027 | 1173 pSettings->aGF_high = 99; |
| 38 | 1174 corrections++; |
| 820 | 1175 setFirstCorrection(parameterId); |
| 38 | 1176 } |
| 997 | 1177 parameterId++; /* 26 */ |
| 1027 | 1178 if(pSettings->aGF_high < 45) |
| 38 | 1179 { |
| 1027 | 1180 pSettings->aGF_high = 45; |
| 38 | 1181 corrections++; |
| 820 | 1182 setFirstCorrection(parameterId); |
| 38 | 1183 } |
| 997 | 1184 parameterId++; /* 27 */ |
| 38 | 1185 /* uint8_t aGF_low; |
| 1186 */ | |
| 1027 | 1187 if(pSettings->aGF_low > 99) |
| 38 | 1188 { |
| 1027 | 1189 pSettings->aGF_low = 99; |
| 38 | 1190 corrections++; |
| 820 | 1191 setFirstCorrection(parameterId); |
| 38 | 1192 } |
| 997 | 1193 parameterId++; /* 28 */ |
| 1027 | 1194 if(pSettings->aGF_low < 10) |
| 38 | 1195 { |
| 1027 | 1196 pSettings->aGF_low = 10; |
| 38 | 1197 corrections++; |
| 820 | 1198 setFirstCorrection(parameterId); |
| 38 | 1199 } |
| 997 | 1200 parameterId++; /* 29 */ |
| 1027 | 1201 if(pSettings->aGF_low > pSettings->aGF_high) |
| 38 | 1202 { |
| 1027 | 1203 pSettings->aGF_low = pSettings->aGF_high; |
| 38 | 1204 corrections++; |
| 820 | 1205 setFirstCorrection(parameterId); |
| 38 | 1206 } |
| 997 | 1207 parameterId++; /* 30 */ |
| 38 | 1208 /* split2x4_Type VPM_conservatism; |
| 1209 */ | |
| 1027 | 1210 if(pSettings->VPM_conservatism.ub.standard > 5) |
| 38 | 1211 { |
| 1027 | 1212 pSettings->VPM_conservatism.ub.standard = 5; |
| 38 | 1213 corrections++; |
| 820 | 1214 setFirstCorrection(parameterId); |
| 38 | 1215 } |
| 997 | 1216 parameterId++; /* 31 */ |
| 1027 | 1217 if(pSettings->VPM_conservatism.ub.alternative > 5) |
| 38 | 1218 { |
| 1027 | 1219 pSettings->VPM_conservatism.ub.alternative = 5; |
| 38 | 1220 corrections++; |
| 820 | 1221 setFirstCorrection(parameterId); |
| 38 | 1222 } |
| 997 | 1223 parameterId++; /* 32 */ |
| 38 | 1224 /* uint8_t safetystopDuration; |
| 1225 */ | |
| 1027 | 1226 if(pSettings->safetystopDuration > 5) |
| 38 | 1227 { |
| 1027 | 1228 pSettings->safetystopDuration = 5; |
| 38 | 1229 corrections++; |
| 820 | 1230 setFirstCorrection(parameterId); |
| 38 | 1231 } |
| 997 | 1232 parameterId++; /* 33 */ |
| 38 | 1233 /* uint8_t AtemMinutenVolumenLiter; |
| 1234 */ | |
| 1027 | 1235 if(pSettings->AtemMinutenVolumenLiter != 25) |
| 38 | 1236 { |
| 1027 | 1237 pSettings->AtemMinutenVolumenLiter = 25; |
| 38 | 1238 corrections++; |
| 820 | 1239 setFirstCorrection(parameterId); |
| 38 | 1240 } |
| 997 | 1241 parameterId++; /* 34 */ |
| 38 | 1242 /* uint8_t ReserveFractionDenominator; |
| 1243 */ | |
| 1027 | 1244 if(pSettings->ReserveFractionDenominator != 4) |
| 38 | 1245 { |
| 1027 | 1246 pSettings->ReserveFractionDenominator = 4; |
| 38 | 1247 corrections++; |
| 820 | 1248 setFirstCorrection(parameterId); |
| 38 | 1249 } |
| 997 | 1250 parameterId++; /* 35 */ |
| 38 | 1251 /* uint8_t salinity; |
| 1252 */ | |
| 1027 | 1253 if(pSettings->salinity > 4) |
| 38 | 1254 { |
| 1027 | 1255 pSettings->salinity = 4; |
| 38 | 1256 corrections++; |
| 820 | 1257 setFirstCorrection(parameterId); |
| 38 | 1258 } |
| 997 | 1259 parameterId++; /* 36 */ |
| 38 | 1260 /* uint8_t last_stop_depth_meter; |
| 1261 */ | |
| 1027 | 1262 if(pSettings->last_stop_depth_meter > 9) |
| 38 | 1263 { |
| 1027 | 1264 pSettings->last_stop_depth_meter = 9; |
| 38 | 1265 corrections++; |
| 820 | 1266 setFirstCorrection(parameterId); |
| 38 | 1267 } |
| 997 | 1268 parameterId++; /* 37 */ |
| 1027 | 1269 if(pSettings->last_stop_depth_meter < 3) |
| 38 | 1270 { |
| 1027 | 1271 pSettings->last_stop_depth_meter = 3; |
| 38 | 1272 corrections++; |
| 820 | 1273 setFirstCorrection(parameterId); |
| 38 | 1274 } |
| 997 | 1275 parameterId++; /* 38 */ |
| 38 | 1276 /* uint8_t stop_increment_depth_meter; |
| 1277 */ | |
| 1027 | 1278 if(pSettings->stop_increment_depth_meter != 3) |
| 38 | 1279 { |
| 1027 | 1280 pSettings->stop_increment_depth_meter = 3; |
| 38 | 1281 corrections++; |
| 820 | 1282 setFirstCorrection(parameterId); |
| 38 | 1283 } |
| 997 | 1284 parameterId++; /* 39 */ |
| 38 | 1285 /* uint8_t brightness; |
| 1286 */ | |
| 1027 | 1287 if(pSettings->brightness > 4) |
| 38 | 1288 { |
| 1027 | 1289 pSettings->brightness = 4; |
| 38 | 1290 corrections++; |
| 820 | 1291 setFirstCorrection(parameterId); |
| 38 | 1292 } |
| 997 | 1293 parameterId++; /* 40 */ |
| 38 | 1294 /* uint8_t date_format; |
| 1295 */ | |
| 1027 | 1296 if( (pSettings->date_format != DDMMYY) && |
| 1297 (pSettings->date_format != MMDDYY) && | |
| 1298 (pSettings->date_format != YYMMDD)) | |
| 38 | 1299 { |
| 1027 | 1300 pSettings->date_format = DDMMYY; |
| 38 | 1301 corrections++; |
| 820 | 1302 setFirstCorrection(parameterId); |
| 38 | 1303 } |
| 997 | 1304 parameterId++; /* 41 */ |
| 38 | 1305 /* uint8_t selected_language; |
| 1306 */ | |
| 1027 | 1307 if(pSettings->selected_language >= LANGUAGE_END) |
| 38 | 1308 { |
| 1027 | 1309 pSettings->selected_language = LANGUAGE_English; |
| 38 | 1310 corrections++; |
| 820 | 1311 setFirstCorrection(parameterId); |
| 38 | 1312 } |
| 997 | 1313 parameterId++; /* 42 */ |
| 38 | 1314 /* char customtext[60]; |
| 1315 */ | |
| 1027 | 1316 if(pSettings->customtext[59] != 0) |
| 38 | 1317 { |
| 1027 | 1318 pSettings->customtext[59] = 0; |
| 38 | 1319 corrections++; |
| 820 | 1320 setFirstCorrection(parameterId); |
| 38 | 1321 } |
| 997 | 1322 parameterId++; /* 43 */ |
| 38 | 1323 /* uint16_t timeoutSurfacemode; |
| 1324 */ | |
| 1027 | 1325 if( (pSettings->timeoutSurfacemode != 20) && // Quick Sleep Option |
| 1326 (pSettings->timeoutSurfacemode != 120)) | |
| 38 | 1327 { |
| 1027 | 1328 pSettings->timeoutSurfacemode = 120; |
| 38 | 1329 corrections++; |
| 820 | 1330 setFirstCorrection(parameterId); |
| 38 | 1331 } |
| 997 | 1332 parameterId++; /* 44 */ |
| 38 | 1333 /* uint8_t timeoutMenuSurface; |
| 1334 */ | |
| 1027 | 1335 if(pSettings->timeoutMenuSurface != 120) |
| 38 | 1336 { |
| 1027 | 1337 pSettings->timeoutMenuSurface = 120; |
| 38 | 1338 corrections++; |
| 820 | 1339 setFirstCorrection(parameterId); |
| 38 | 1340 } |
| 997 | 1341 parameterId++; /* 45 */ |
| 38 | 1342 /* uint8_t timeoutMenuDive; |
| 1343 */ | |
| 1027 | 1344 if(pSettings->timeoutMenuDive != 120) |
| 38 | 1345 { |
| 1027 | 1346 pSettings->timeoutMenuDive = 120; |
| 38 | 1347 corrections++; |
| 820 | 1348 setFirstCorrection(parameterId); |
| 38 | 1349 } |
| 997 | 1350 parameterId++; /* 46 */ |
| 38 | 1351 /* uint8_t timeoutMenuEdit; |
| 1352 */ | |
| 1027 | 1353 if(pSettings->timeoutMenuEdit != 120) |
| 38 | 1354 { |
| 1027 | 1355 pSettings->timeoutMenuEdit = 120; |
| 38 | 1356 corrections++; |
| 820 | 1357 setFirstCorrection(parameterId); |
| 38 | 1358 } |
| 997 | 1359 parameterId++; /* 47 */ |
| 38 | 1360 /* uint8_t timeoutInfo; |
| 1361 */ | |
| 1027 | 1362 if(pSettings->timeoutInfo != 120) |
| 38 | 1363 { |
| 1027 | 1364 pSettings->timeoutInfo = 120; |
| 38 | 1365 corrections++; |
| 820 | 1366 setFirstCorrection(parameterId); |
| 38 | 1367 } |
| 997 | 1368 parameterId++; /* 48 */ |
| 38 | 1369 /* uint8_t timeoutInfoCompass; |
| 1370 */ | |
| 1027 | 1371 if(pSettings->timeoutInfoCompass != 60) |
| 38 | 1372 { |
| 1027 | 1373 pSettings->timeoutInfoCompass = 60; |
| 38 | 1374 corrections++; |
| 820 | 1375 setFirstCorrection(parameterId); |
| 38 | 1376 } |
| 997 | 1377 parameterId++; /* 49 */ |
| 38 | 1378 /* uint8_t design; |
| 1379 */ | |
| 1027 | 1380 if(pSettings->design != 7) |
| 38 | 1381 { |
| 1027 | 1382 pSettings->design = 7; |
| 38 | 1383 corrections++; |
| 820 | 1384 setFirstCorrection(parameterId); |
| 38 | 1385 } |
| 997 | 1386 parameterId++; /* 50 */ |
| 38 | 1387 /* uint16_t timeoutDiveReachedZeroDepth; |
| 1388 */ | |
| 1027 | 1389 if(pSettings->timeoutDiveReachedZeroDepth != 300) |
| 38 | 1390 { |
| 1027 | 1391 pSettings->timeoutDiveReachedZeroDepth = 300; |
| 38 | 1392 corrections++; |
| 820 | 1393 setFirstCorrection(parameterId); |
| 38 | 1394 } |
| 997 | 1395 parameterId++; /* 51 */ |
| 38 | 1396 /* uint16_t divetimeToCreateLogbook; |
| 1397 */ | |
| 1027 | 1398 if(pSettings->divetimeToCreateLogbook != 60) |
| 38 | 1399 { |
| 1027 | 1400 pSettings->divetimeToCreateLogbook = 60; |
| 38 | 1401 corrections++; |
| 820 | 1402 setFirstCorrection(parameterId); |
| 38 | 1403 } |
| 997 | 1404 parameterId++; /* 52 */ |
| 1027 | 1405 if(pSettings->slowExitTime > 9) |
| 882 | 1406 { |
| 1027 | 1407 pSettings->divetimeToCreateLogbook = 0; |
| 882 | 1408 corrections++; |
| 1409 setFirstCorrection(parameterId); | |
| 1410 } | |
| 997 | 1411 parameterId++; /* 53 */ |
| 951 | 1412 |
| 1027 | 1413 if(pSettings->warningBuzzer > 1) |
| 951 | 1414 { |
| 1027 | 1415 pSettings->warningBuzzer = 0; |
| 951 | 1416 corrections++; |
| 1417 setFirstCorrection(parameterId); | |
| 1418 } | |
| 997 | 1419 parameterId++; /* 54 */ |
| 951 | 1420 |
| 1421 | |
| 38 | 1422 /* uint8_t serialHigh; |
| 1423 */ | |
| 1424 | |
| 1425 /* uint8_t serialLow; | |
| 1426 */ | |
| 1427 | |
| 1428 /* SUFirmware firmwareVersion16to32bit; | |
| 1429 */ | |
| 1430 | |
| 1431 /* uint32_t backup_localtime_rtc_tr; | |
| 1432 */ | |
| 1433 | |
| 1434 /* uint32_t backup_localtime_rtc_dr; | |
| 1435 */ | |
| 1436 | |
| 1437 /* uint16_t totalDiveCounter; | |
| 1438 */ | |
| 1439 | |
| 1440 /* uint16_t personalDiveCount; | |
| 1441 */ | |
| 1442 | |
| 1443 /* uint8_t showDebugInfo; | |
| 1444 */ | |
|
492
4ce932235578
Added compiler switch for existing debug view parameter
Ideenmodellierer
parents:
488
diff
changeset
|
1445 |
|
4ce932235578
Added compiler switch for existing debug view parameter
Ideenmodellierer
parents:
488
diff
changeset
|
1446 #ifdef HAVE_DEBUG_VIEW |
| 1027 | 1447 if(pSettings->showDebugInfo > 1) |
| 38 | 1448 { |
| 1027 | 1449 pSettings->showDebugInfo = 0; |
| 38 | 1450 corrections++; |
| 1451 } | |
|
492
4ce932235578
Added compiler switch for existing debug view parameter
Ideenmodellierer
parents:
488
diff
changeset
|
1452 #else |
| 1027 | 1453 pSettings->showDebugInfo = 0; |
|
492
4ce932235578
Added compiler switch for existing debug view parameter
Ideenmodellierer
parents:
488
diff
changeset
|
1454 #endif |
| 38 | 1455 |
| 1456 /* uint8_t ButtonResponsiveness[4]; | |
| 1457 */ | |
| 1458 // Base value, index 3 | |
| 1027 | 1459 if(pSettings->ButtonResponsiveness[3] < MIN_BUTTONRESPONSIVENESS_GUI) |
| 38 | 1460 { |
| 1027 | 1461 pSettings->ButtonResponsiveness[3] = MIN_BUTTONRESPONSIVENESS_GUI; |
| 38 | 1462 corrections++; |
| 820 | 1463 setFirstCorrection(parameterId); |
| 38 | 1464 } |
| 1465 else | |
| 1027 | 1466 if(pSettings->ButtonResponsiveness[3] > MAX_BUTTONRESPONSIVENESS_GUI) |
| 38 | 1467 { |
| 1027 | 1468 pSettings->ButtonResponsiveness[3] = MAX_BUTTONRESPONSIVENESS_GUI; |
| 38 | 1469 corrections++; |
| 820 | 1470 setFirstCorrection(parameterId); |
| 38 | 1471 } |
| 997 | 1472 parameterId++; /* 55 */ |
| 38 | 1473 // flex values 0, 1, 2 |
| 1474 for(int i=0; i<3;i++) | |
| 1475 { | |
| 1027 | 1476 if(pSettings->ButtonResponsiveness[i] < MIN_BUTTONRESPONSIVENESS) // 50-10 //Fix for broken buttons. :) |
| 38 | 1477 { |
| 1027 | 1478 pSettings->ButtonResponsiveness[i] = MIN_BUTTONRESPONSIVENESS; |
| 38 | 1479 corrections++; |
| 820 | 1480 setFirstCorrection(parameterId); |
| 38 | 1481 } |
| 1482 else | |
| 1027 | 1483 if(pSettings->ButtonResponsiveness[i] > MAX_BUTTONRESPONSIVENESS) // 110+20 |
| 38 | 1484 { |
| 1027 | 1485 pSettings->ButtonResponsiveness[i] = MAX_BUTTONRESPONSIVENESS; |
| 38 | 1486 corrections++; |
| 820 | 1487 setFirstCorrection(parameterId); |
| 38 | 1488 } |
| 1489 } | |
| 997 | 1490 parameterId++; /* 56 */ |
| 38 | 1491 /* uint8_t buttonBalance[3]; |
| 1492 */ | |
| 1493 for(int i=0; i<3;i++) | |
| 1494 { | |
| 1027 | 1495 if(pSettings->buttonBalance[i] < 2) // 2 = -10 |
| 38 | 1496 { |
| 1027 | 1497 pSettings->buttonBalance[i] = 2; |
| 38 | 1498 corrections++; |
| 820 | 1499 setFirstCorrection(parameterId); |
| 38 | 1500 } |
| 1501 else | |
| 1027 | 1502 if(pSettings->buttonBalance[i] > 5) // 3 = 0, 4 = +10, 5 = +20 |
| 38 | 1503 { |
| 1027 | 1504 pSettings->buttonBalance[i] = 5; |
| 38 | 1505 corrections++; |
| 820 | 1506 setFirstCorrection(parameterId); |
| 38 | 1507 } |
| 1508 } | |
| 997 | 1509 parameterId++; /* 57 */ |
| 38 | 1510 /* uint8_t nonMetricalSystem; |
| 1511 */ | |
| 1027 | 1512 if(pSettings->nonMetricalSystem > 1) |
| 38 | 1513 { |
| 1027 | 1514 pSettings->nonMetricalSystem = 1; |
| 38 | 1515 corrections++; |
| 820 | 1516 setFirstCorrection(parameterId); |
| 38 | 1517 } |
| 997 | 1518 parameterId++; /* 58 */ |
| 38 | 1519 /* uint8_t fallbackToFixedSetpoint; |
| 1520 */ | |
| 1027 | 1521 if(pSettings->fallbackToFixedSetpoint > 1) |
| 38 | 1522 { |
| 1027 | 1523 pSettings->fallbackToFixedSetpoint = 1; |
| 38 | 1524 corrections++; |
| 820 | 1525 setFirstCorrection(parameterId); |
| 38 | 1526 } |
| 997 | 1527 parameterId++; /* 59 */ |
| 38 | 1528 /* uint8_t bluetoothActive; |
| 1529 */ | |
| 1027 | 1530 if(pSettings->bluetoothActive > 1) |
| 38 | 1531 { |
| 1027 | 1532 pSettings->bluetoothActive = 1; |
| 38 | 1533 corrections++; |
| 820 | 1534 setFirstCorrection(parameterId); |
| 38 | 1535 } |
| 997 | 1536 parameterId++; /* 60 */ |
| 38 | 1537 /* uint8_t safetystopDepth; |
| 1538 */ | |
| 1027 | 1539 if(pSettings->safetystopDepth > 6) |
| 38 | 1540 { |
| 1027 | 1541 pSettings->safetystopDepth = 6; |
| 38 | 1542 corrections++; |
| 820 | 1543 setFirstCorrection(parameterId); |
| 38 | 1544 } |
| 997 | 1545 parameterId++; /* 61 */ |
| 1027 | 1546 if(pSettings->safetystopDepth < 3) |
| 38 | 1547 { |
| 1027 | 1548 pSettings->safetystopDepth = 3; |
| 38 | 1549 corrections++; |
| 820 | 1550 setFirstCorrection(parameterId); |
| 38 | 1551 } |
| 997 | 1552 parameterId++; /* 62 */ |
| 38 | 1553 /* uint32_t updateSettingsAllowedFromHeader; |
| 1554 */ | |
| 1555 | |
| 1556 /* uint8_t ppo2sensors_deactivated; | |
| 1557 */ | |
| 1027 | 1558 if(pSettings->ppo2sensors_deactivated > (1+2+4)) |
| 38 | 1559 { |
| 1027 | 1560 pSettings->ppo2sensors_deactivated = 0; |
| 38 | 1561 corrections++; |
| 820 | 1562 setFirstCorrection(parameterId); |
| 38 | 1563 } |
| 997 | 1564 parameterId++; /* 63 */ |
| 38 | 1565 /* uint8_t tX_colorscheme; |
| 1566 */ | |
| 1027 | 1567 if(pSettings->tX_colorscheme > 3) |
| 38 | 1568 { |
| 1027 | 1569 pSettings->tX_colorscheme = 0; |
| 38 | 1570 corrections++; |
| 820 | 1571 setFirstCorrection(parameterId); |
| 38 | 1572 } |
| 997 | 1573 parameterId++; /* 64 */ |
| 38 | 1574 /* uint8_t tX_userselectedLeftLowerCornerPrimary; |
| 1575 */ | |
| 1027 | 1576 if(pSettings->tX_userselectedLeftLowerCornerPrimary >= LLC_END) |
| 38 | 1577 { |
| 1027 | 1578 pSettings->tX_userselectedLeftLowerCornerPrimary = LLC_Temperature; |
| 38 | 1579 corrections++; |
| 820 | 1580 setFirstCorrection(parameterId); |
| 38 | 1581 } |
| 997 | 1582 parameterId++; /* 65 */ |
| 38 | 1583 /* uint8_t tX_userselectedLeftLowerCornerTimeout; |
| 1584 */ | |
| 1027 | 1585 if(pSettings->tX_userselectedLeftLowerCornerTimeout > 60) |
| 38 | 1586 { |
| 1027 | 1587 pSettings->tX_userselectedLeftLowerCornerTimeout = 0; |
| 38 | 1588 corrections++; |
| 820 | 1589 setFirstCorrection(parameterId); |
| 38 | 1590 } |
| 997 | 1591 parameterId++; /* 66 */ |
| 38 | 1592 /* uint8_t tX_customViewPrimary; |
| 1593 */ | |
| 1027 | 1594 if(pSettings->tX_customViewPrimary >= CVIEW_END) |
| 38 | 1595 { |
| 1027 | 1596 pSettings->tX_customViewPrimary = 1; |
| 38 | 1597 corrections++; |
| 820 | 1598 setFirstCorrection(parameterId); |
| 38 | 1599 } |
| 997 | 1600 parameterId++; /* 67 */ |
| 38 | 1601 /* uint8_t tX_customViewTimeout; |
| 1602 */ | |
| 1027 | 1603 if(pSettings->tX_customViewTimeout > 60) |
| 38 | 1604 { |
| 1027 | 1605 pSettings->tX_customViewTimeout = 0; |
| 38 | 1606 corrections++; |
| 820 | 1607 setFirstCorrection(parameterId); |
| 38 | 1608 } |
| 997 | 1609 parameterId++; /* 68 */ |
| 38 | 1610 /* uint8_t timeoutEnterButtonSelectDive; |
| 1611 */ | |
| 1027 | 1612 if(pSettings->timeoutEnterButtonSelectDive != 10) |
| 38 | 1613 { |
| 1027 | 1614 pSettings->timeoutEnterButtonSelectDive = 10; |
| 38 | 1615 corrections++; |
| 820 | 1616 setFirstCorrection(parameterId); |
| 38 | 1617 } |
| 997 | 1618 parameterId++; /* 69 */ |
| 38 | 1619 /* uint8_t logbookOffset; |
| 1620 */ | |
| 1027 | 1621 if(pSettings->logbookOffset > 9000) |
| 38 | 1622 { |
| 1027 | 1623 pSettings->logbookOffset = 0; |
| 38 | 1624 corrections++; |
| 820 | 1625 setFirstCorrection(parameterId); |
| 38 | 1626 } |
| 997 | 1627 parameterId++; /* 70 */ |
| 38 | 1628 /* uint8_t alwaysShowPPO2; |
| 1629 */ | |
| 1027 | 1630 if(pSettings->alwaysShowPPO2 > 1) |
| 38 | 1631 { |
| 1027 | 1632 pSettings->alwaysShowPPO2 = 0; |
| 38 | 1633 corrections++; |
| 820 | 1634 setFirstCorrection(parameterId); |
| 38 | 1635 } |
| 997 | 1636 parameterId++; /* 71 */ |
| 38 | 1637 /* uint8_t extraDisplay; |
| 1638 */ | |
| 1027 | 1639 if(pSettings->extraDisplay >= EXTRADISPLAY_END) |
| 38 | 1640 { |
| 1027 | 1641 pSettings->extraDisplay = EXTRADISPLAY_BIGFONT; |
| 38 | 1642 corrections++; |
| 820 | 1643 setFirstCorrection(parameterId); |
| 38 | 1644 } |
| 997 | 1645 parameterId++; /* 72 */ |
| 38 | 1646 /* int8_t offsetPressure_mbar; |
| 1647 */ | |
| 1027 | 1648 if((pSettings->offsetPressure_mbar > PRESSURE_OFFSET_LIMIT_MBAR) || |
| 1649 (pSettings->offsetPressure_mbar < -1 * PRESSURE_OFFSET_LIMIT_MBAR)) | |
| 38 | 1650 { |
| 1027 | 1651 pSettings->offsetPressure_mbar = 0; |
| 38 | 1652 corrections++; |
| 820 | 1653 setFirstCorrection(parameterId); |
| 38 | 1654 } |
| 997 | 1655 parameterId++; /* 73 */ |
| 38 | 1656 /* int8_t offsetTemperature_centigrad; |
| 1657 */ | |
| 1027 | 1658 if((pSettings->offsetTemperature_centigrad > 20) || |
| 1659 (pSettings->offsetTemperature_centigrad < -20)) | |
| 38 | 1660 { |
| 1027 | 1661 pSettings->offsetTemperature_centigrad = 0; |
| 38 | 1662 corrections++; |
| 820 | 1663 setFirstCorrection(parameterId); |
| 38 | 1664 } |
| 997 | 1665 parameterId++; /* 74 */ |
| 38 | 1666 /* uint8_t gasConsumption_travel_l_min; |
| 1667 */ | |
| 1027 | 1668 if((pSettings->gasConsumption_travel_l_min < 5) || |
| 1669 (pSettings->gasConsumption_travel_l_min > 50)) | |
| 38 | 1670 { |
| 1027 | 1671 pSettings->gasConsumption_travel_l_min = 20; |
| 38 | 1672 corrections++; |
| 820 | 1673 setFirstCorrection(parameterId); |
| 38 | 1674 } |
| 997 | 1675 parameterId++; /* 75 */ |
| 38 | 1676 /* uint8_t gasConsumption_bottom_l_min; |
| 1677 */ | |
| 1027 | 1678 if((pSettings->gasConsumption_bottom_l_min < 5) || |
| 1679 (pSettings->gasConsumption_bottom_l_min > 50)) | |
| 38 | 1680 { |
| 1027 | 1681 pSettings->gasConsumption_bottom_l_min = 20; |
| 38 | 1682 corrections++; |
| 820 | 1683 setFirstCorrection(parameterId); |
| 38 | 1684 } |
| 997 | 1685 parameterId++; /* 76 */ |
| 38 | 1686 /* uint8_t gasConsumption_deco_l_min; |
| 1687 */ | |
| 1027 | 1688 if((pSettings->gasConsumption_deco_l_min < 5) || |
| 1689 (pSettings->gasConsumption_deco_l_min > 50)) | |
| 38 | 1690 { |
| 1027 | 1691 pSettings->gasConsumption_deco_l_min = 20; |
| 38 | 1692 corrections++; |
| 820 | 1693 setFirstCorrection(parameterId); |
| 38 | 1694 } |
| 997 | 1695 parameterId++; /* 77 */ |
| 38 | 1696 /* uint8_t showDebugInfo; |
| 1697 */ | |
| 1698 #ifdef BOOT16 | |
| 1027 | 1699 pSettings->showDebugInfo = 0; |
| 38 | 1700 #else |
| 1027 | 1701 if(pSettings->showDebugInfo > 1) |
| 1702 pSettings->showDebugInfo = 0; | |
| 38 | 1703 |
| 1704 #endif | |
| 1705 | |
| 1706 /* uint8_t selected_language; | |
| 1707 */ | |
| 1708 #ifdef BOOT16 | |
| 1027 | 1709 if(pSettings->selected_language > 1) |
| 1710 pSettings->selected_language = 0; | |
| 38 | 1711 #else |
| 1027 | 1712 if(pSettings->selected_language > 4) |
| 1713 pSettings->selected_language = 0; | |
| 38 | 1714 #endif |
| 1715 | |
| 1716 | |
| 1717 /* uint8_t display_toogle_desc; 1/10 seconds | |
| 1718 */ | |
| 1027 | 1719 if((pSettings->display_toogle_desc < 20) || (pSettings->display_toogle_desc > 600)) |
| 38 | 1720 { |
| 1027 | 1721 pSettings->display_toogle_desc = SettingsStandard.display_toogle_desc; |
| 38 | 1722 corrections++; |
| 820 | 1723 setFirstCorrection(parameterId); |
| 38 | 1724 } |
| 997 | 1725 parameterId++; /* 78 */ |
| 38 | 1726 /* uint8_t debugModeOnStart; |
| 1727 */ | |
| 1027 | 1728 if(pSettings->debugModeOnStart > 1) |
| 38 | 1729 { |
| 1027 | 1730 pSettings->debugModeOnStart = 0; |
| 38 | 1731 corrections++; |
| 820 | 1732 setFirstCorrection(parameterId); |
| 38 | 1733 } |
| 997 | 1734 parameterId++; /* 79 */ |
| 38 | 1735 |
| 1736 /* uint8_t IAmStolenPleaseKillMe; | |
| 1737 */ | |
| 1738 | |
| 1739 if(hardwareDataGetPointer()->primarySerial == 90) | |
| 1027 | 1740 pSettings->IAmStolenPleaseKillMe++; |
| 38 | 1741 else |
| 1027 | 1742 pSettings->IAmStolenPleaseKillMe = 0; |
| 38 | 1743 |
| 1744 | |
| 1745 /* uint8_t debugModeOnStart; | |
| 1746 */ | |
| 1027 | 1747 if(pSettings->compassBearing > 360) |
| 38 | 1748 { |
| 1027 | 1749 pSettings->compassBearing = 0; |
| 38 | 1750 corrections++; |
| 820 | 1751 setFirstCorrection(parameterId); |
| 38 | 1752 } |
| 1753 | |
| 997 | 1754 parameterId++; /* 80 */ |
| 38 | 1755 /* uint8_t lastKnownBatteryPercentage; |
| 1756 */ | |
| 1027 | 1757 if(pSettings->lastKnownBatteryPercentage > 100) |
| 38 | 1758 { |
| 1027 | 1759 pSettings->lastKnownBatteryPercentage = 100; |
| 38 | 1760 corrections++; |
| 820 | 1761 setFirstCorrection(parameterId); |
| 38 | 1762 } |
| 997 | 1763 parameterId++; /* 81 */ |
| 38 | 1764 /* uint8_t VPM_model |
| 1765 */ | |
| 1027 | 1766 if((pSettings->VPM_model != VPM_FROM_FORTRAN) && (pSettings->VPM_model != VPM_BACHELORWORK)) |
| 38 | 1767 { |
| 1027 | 1768 pSettings->VPM_model = VPM_FROM_FORTRAN; |
| 38 | 1769 corrections++; |
| 820 | 1770 setFirstCorrection(parameterId); |
| 38 | 1771 } |
| 997 | 1772 parameterId++; /* 82 */ |
| 38 | 1773 /* uint8_t Buehlmann_model |
| 1774 */ | |
| 1027 | 1775 if((pSettings->GF_model != BUEHLMANN_OSTC4) && (pSettings->GF_model != BUEHLMANN_hwOS)) |
| 38 | 1776 { |
| 1027 | 1777 pSettings->GF_model = BUEHLMANN_OSTC4; |
| 38 | 1778 corrections++; |
| 820 | 1779 setFirstCorrection(parameterId); |
| 38 | 1780 } |
| 997 | 1781 parameterId++; /* 83 */ |
| 1027 | 1782 if(pSettings->FlipDisplay > 1) /* only boolean values allowed */ |
| 997 | 1783 { |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
1784 setFlipDisplay(1); |
|
111
38785aa95837
Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents:
75
diff
changeset
|
1785 corrections++; |
| 820 | 1786 setFirstCorrection(parameterId); |
| 997 | 1787 } |
| 1788 parameterId++; /* 84 */ | |
| 522 | 1789 #ifdef ENABLE_MOTION_CONTROL |
| 1027 | 1790 if(pSettings->MotionDetection >= MOTION_DETECT_END) |
|
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:
324
diff
changeset
|
1791 { |
| 1027 | 1792 pSettings->MotionDetection = MOTION_DETECT_OFF; |
|
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:
324
diff
changeset
|
1793 corrections++; |
| 820 | 1794 setFirstCorrection(parameterId); |
|
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:
324
diff
changeset
|
1795 } |
| 522 | 1796 #else |
| 1027 | 1797 pSettings->MotionDetection = MOTION_DETECT_OFF; |
| 1798 pSettings->viewPortMode = 0; | |
| 1799 pSettings->viewRoll = 0.0; | |
| 1800 pSettings->viewPitch = 0.0; | |
| 1801 pSettings->viewYaw = 0.0; | |
| 522 | 1802 #endif |
| 997 | 1803 parameterId++; /* 85 */ |
| 1027 | 1804 if(pSettings->compassInertia > MAX_COMPASS_COMP) |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
533
diff
changeset
|
1805 { |
| 1027 | 1806 pSettings->compassInertia = 0; |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
533
diff
changeset
|
1807 corrections++; |
| 820 | 1808 setFirstCorrection(parameterId); |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
533
diff
changeset
|
1809 } |
| 997 | 1810 parameterId++; /* 86 */ |
| 1027 | 1811 if(pSettings->tX_customViewPrimaryBF > CVIEW_T3_END) |
|
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
1812 { |
| 1027 | 1813 pSettings->tX_customViewPrimaryBF = CVIEW_T3_Decostop; |
|
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
1814 corrections++; |
| 820 | 1815 setFirstCorrection(parameterId); |
|
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
1816 } |
| 997 | 1817 parameterId++; /* 87 */ |
| 1027 | 1818 if(pSettings->viewPortMode > MAX_VIEWPORT_MODE) |
| 546 | 1819 { |
| 1027 | 1820 pSettings->viewPortMode = 0; |
| 546 | 1821 corrections++; |
| 820 | 1822 setFirstCorrection(parameterId); |
| 546 | 1823 } |
| 997 | 1824 parameterId++; /* 88 */ |
| 1027 | 1825 if(pSettings->ppo2sensors_source >= O2_SENSOR_SOURCE_MAX) |
|
560
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
1826 { |
| 1027 | 1827 pSettings->ppo2sensors_source = O2_SENSOR_SOURCE_OPTIC; |
| 1828 pSettings->ppo2sensors_calibCoeff[0] = 0.0; | |
| 1829 pSettings->ppo2sensors_calibCoeff[1] = 0.0; | |
| 1830 pSettings->ppo2sensors_calibCoeff[2] = 0.0; | |
|
560
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
1831 corrections++; |
| 820 | 1832 setFirstCorrection(parameterId); |
|
560
5d80bb8d22cb
Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents:
550
diff
changeset
|
1833 } |
| 997 | 1834 parameterId++; /* 89 */ |
| 1027 | 1835 if(pSettings->amPMTime > 1) /* only boolean values allowed */ |
| 567 | 1836 { |
| 1027 | 1837 pSettings->amPMTime = 0; |
| 567 | 1838 corrections++; |
| 820 | 1839 setFirstCorrection(parameterId); |
| 567 | 1840 } |
| 997 | 1841 parameterId++; /* 90 */ |
| 1027 | 1842 if(pSettings->autoSetpoint > 1) /* only boolean values allowed */ |
| 650 | 1843 { |
| 1027 | 1844 pSettings->autoSetpoint = 0; |
| 650 | 1845 corrections++; |
| 820 | 1846 setFirstCorrection(parameterId); |
| 650 | 1847 } |
| 997 | 1848 parameterId++; /* 91 */ |
| 1027 | 1849 if (pSettings->scrubberActiveId > 0x03) { |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
1850 /* scrubber active is used as bitfield => two timer => 2 bits in use */ |
| 1027 | 1851 pSettings->scrubberActiveId = 0x00; |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
1852 corrections++; |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
1853 setFirstCorrection(parameterId); |
| 710 | 1854 } |
| 997 | 1855 parameterId++; /* 92 */ |
| 1027 | 1856 if((pSettings->scrubberData[0].TimerMax > MAX_SCRUBBER_TIME) || pSettings->scrubberData[0].TimerCur < MIN_SCRUBBER_TIME || pSettings->scrubberData[0].TimerCur > (int16_t)MAX_SCRUBBER_TIME) |
| 650 | 1857 { |
| 1027 | 1858 pSettings->scrubberData[0].TimerMax = 0; |
| 1859 pSettings->scrubberData[0].TimerCur = 0; | |
| 710 | 1860 corrections++; |
| 820 | 1861 setFirstCorrection(parameterId); |
| 710 | 1862 } |
|
1001
21142f4fa968
Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents:
997
diff
changeset
|
1863 parameterId++; /* 93 */ |
| 1027 | 1864 if((pSettings->scrubberData[1].TimerMax > MAX_SCRUBBER_TIME) || pSettings->scrubberData[1].TimerCur < MIN_SCRUBBER_TIME || pSettings->scrubberData[1].TimerCur > (int16_t)MAX_SCRUBBER_TIME) |
| 710 | 1865 { |
| 1027 | 1866 pSettings->scrubberData[1].TimerMax = 0; |
| 1867 pSettings->scrubberData[1].TimerCur = 0; | |
| 650 | 1868 corrections++; |
| 820 | 1869 setFirstCorrection(parameterId); |
| 650 | 1870 } |
| 997 | 1871 parameterId++; /* 94 */ |
| 1027 | 1872 if (pSettings->scrubTimerMode == INVALID_SCRUB_TIMER_OFF || pSettings->scrubTimerMode > SCRUB_TIMER_END) { |
| 1873 pSettings->scrubTimerMode = SCRUB_TIMER_MINUTES; | |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
652
diff
changeset
|
1874 corrections++; |
| 820 | 1875 setFirstCorrection(parameterId); |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
652
diff
changeset
|
1876 } |
| 997 | 1877 parameterId++; /* 95 */ |
| 1027 | 1878 if((pSettings->pscr_lung_ratio > PSCR_MAX_LUNG_RATIO) || (pSettings->pscr_lung_ratio < PSCR_MIN_LUNG_RATIO)) |
| 662 | 1879 { |
| 1027 | 1880 pSettings->pscr_lung_ratio = 10; |
| 662 | 1881 corrections++; |
| 820 | 1882 setFirstCorrection(parameterId); |
| 662 | 1883 } |
| 997 | 1884 parameterId++; /* 96 */ |
| 1027 | 1885 if(pSettings->pscr_o2_drop > PSCR_MAX_O2_DROP) |
| 662 | 1886 { |
| 1027 | 1887 pSettings->pscr_o2_drop = 4; |
| 662 | 1888 corrections++; |
| 820 | 1889 setFirstCorrection(parameterId); |
| 662 | 1890 } |
| 997 | 1891 parameterId++; /* 97 */ |
| 1027 | 1892 if(pSettings->co2_sensor_active > 1) |
| 662 | 1893 { |
| 1027 | 1894 pSettings->co2_sensor_active = 0; |
| 662 | 1895 corrections++; |
| 820 | 1896 setFirstCorrection(parameterId); |
| 662 | 1897 } |
| 997 | 1898 parameterId++; /* 98 */ |
| 1027 | 1899 if(pSettings->ext_uart_protocol > UART_MAX_PROTOCOL) |
| 687 | 1900 { |
| 1027 | 1901 pSettings->ext_uart_protocol = 0; |
| 687 | 1902 corrections++; |
| 820 | 1903 setFirstCorrection(parameterId); |
| 687 | 1904 } |
| 997 | 1905 parameterId++; /* 99 */ |
| 1027 | 1906 if((pSettings->ext_sensor_map[0] >= SENSOR_END) |
| 1907 || (pSettings->ext_sensor_map[1] >= SENSOR_END) | |
| 1908 || (pSettings->ext_sensor_map[2] >= SENSOR_END) | |
| 1909 || (pSettings->ext_sensor_map[3] >= SENSOR_END) | |
| 1910 || (pSettings->ext_sensor_map[4] >= SENSOR_END) | |
| 1911 || (pSettings->ext_sensor_map[5] >= SENSOR_END) | |
| 1912 || (pSettings->ext_sensor_map[6] >= SENSOR_END) | |
| 1913 || (pSettings->ext_sensor_map[7] >= SENSOR_END)) | |
|
728
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
715
diff
changeset
|
1914 { |
| 1027 | 1915 pSettings->ext_sensor_map[0] = SENSOR_OPTIC; |
| 1916 pSettings->ext_sensor_map[1] = SENSOR_OPTIC; | |
| 1917 pSettings->ext_sensor_map[2] = SENSOR_OPTIC; | |
| 1918 pSettings->ext_sensor_map[3] = SENSOR_NONE; | |
| 1919 pSettings->ext_sensor_map[4] = SENSOR_NONE; | |
| 1920 pSettings->ext_sensor_map[5] = SENSOR_NONE; | |
| 1921 pSettings->ext_sensor_map[6] = SENSOR_NONE; | |
| 1922 pSettings->ext_sensor_map[7] = SENSOR_NONE; | |
|
728
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
715
diff
changeset
|
1923 corrections++; |
| 820 | 1924 setFirstCorrection(parameterId); |
|
728
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
715
diff
changeset
|
1925 } |
| 997 | 1926 parameterId++; /* 100 */ |
| 1027 | 1927 if(pSettings->buttonLockActive > 1) |
|
740
5078da3845c0
Added button lock after wakeup in surface mode:
Ideenmodellierer
parents:
733
diff
changeset
|
1928 { |
| 1027 | 1929 pSettings->buttonLockActive = 1; |
|
740
5078da3845c0
Added button lock after wakeup in surface mode:
Ideenmodellierer
parents:
733
diff
changeset
|
1930 corrections++; |
| 820 | 1931 setFirstCorrection(parameterId); |
|
740
5078da3845c0
Added button lock after wakeup in surface mode:
Ideenmodellierer
parents:
733
diff
changeset
|
1932 } |
| 997 | 1933 parameterId++; /* 101 */ |
| 1027 | 1934 if (pSettings->compassDeclinationDeg > MAX_COMPASS_DECLINATION_DEG) { |
| 1935 pSettings->compassDeclinationDeg = MAX_COMPASS_DECLINATION_DEG; | |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
768
diff
changeset
|
1936 |
|
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
768
diff
changeset
|
1937 corrections++; |
| 820 | 1938 setFirstCorrection(parameterId); |
| 1027 | 1939 } else if (pSettings->compassDeclinationDeg < -MAX_COMPASS_DECLINATION_DEG) { |
| 1940 pSettings->compassDeclinationDeg = -MAX_COMPASS_DECLINATION_DEG; | |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
768
diff
changeset
|
1941 |
|
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
768
diff
changeset
|
1942 corrections++; |
| 820 | 1943 setFirstCorrection(parameterId); |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
768
diff
changeset
|
1944 } |
| 997 | 1945 parameterId++; /* 102 */ |
| 1027 | 1946 if (pSettings->timerDurationS > 599) { |
| 1947 pSettings->timerDurationS = 599; | |
|
805
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
801
diff
changeset
|
1948 |
|
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
801
diff
changeset
|
1949 corrections++; |
| 820 | 1950 setFirstCorrection(parameterId); |
| 1027 | 1951 } else if (pSettings->timerDurationS < 1) { |
| 1952 pSettings->timerDurationS = 1; | |
|
805
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
801
diff
changeset
|
1953 |
|
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
801
diff
changeset
|
1954 corrections++; |
| 820 | 1955 setFirstCorrection(parameterId); |
|
805
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
801
diff
changeset
|
1956 } |
| 997 | 1957 parameterId++; /* 103 */ |
| 1027 | 1958 if(pSettings->cvAutofocus > 1) |
|
834
2a8af51ab04d
Added event based display changes for big font view:
Ideenmodellierer
parents:
830
diff
changeset
|
1959 { |
|
2a8af51ab04d
Added event based display changes for big font view:
Ideenmodellierer
parents:
830
diff
changeset
|
1960 corrections++; |
| 1027 | 1961 pSettings->cvAutofocus = 0; |
|
834
2a8af51ab04d
Added event based display changes for big font view:
Ideenmodellierer
parents:
830
diff
changeset
|
1962 } |
| 997 | 1963 parameterId++; /* 104 */ |
| 1027 | 1964 if((pSettings->timeZone.hours > 14) |
| 1965 || (pSettings->timeZone.hours < -12) | |
| 1966 || (pSettings->timeZone.minutes > 45)) | |
| 949 | 1967 { |
| 1027 | 1968 pSettings->timeZone.hours = 0; |
| 1969 pSettings->timeZone.minutes = 0; | |
| 949 | 1970 corrections++; |
| 1971 } | |
| 997 | 1972 parameterId++; /* 105 */ |
| 662 | 1973 if(corrections) |
| 1974 { | |
| 1975 settingsWarning = 1; | |
| 1976 } | |
| 1977 else | |
| 1978 | |
| 38 | 1979 if(corrections > 255) |
| 662 | 1980 { |
| 1981 corrections = 255; | |
| 1982 } | |
| 1983 | |
| 820 | 1984 SettingsStatus.Corrections = corrections; |
| 662 | 1985 return (uint8_t)corrections; |
| 38 | 1986 } |
| 1987 | |
| 870 | 1988 #ifndef BOOTLOADER_STANDALONE |
| 38 | 1989 /* always at 0x8080000, do not move -> bootloader access */ |
| 1990 const SFirmwareData* firmwareDataGetPointer(void) | |
| 1991 { | |
| 1992 return &firmware_FirmwareData; | |
| 1993 } | |
| 1994 | |
| 1995 | |
| 1017 | 1996 #if 0 |
| 38 | 1997 #ifndef SPECIALPROGRAMM |
| 1998 const SHardwareData* hardwareDataGetPointer(void) | |
| 1999 { | |
| 2000 return (SHardwareData *)HARDWAREDATA_ADDRESS; | |
| 2001 } | |
| 2002 #endif | |
| 870 | 2003 #endif |
| 1017 | 2004 #endif |
| 38 | 2005 const SSettings* settingsGetPointerStandard(void) |
| 2006 { | |
| 2007 return &SettingsStandard; | |
| 2008 } | |
| 2009 | |
| 2010 | |
| 2011 void hardwareBatchCode(uint8_t *high, uint8_t *low) | |
| 2012 { | |
| 2013 if(high) | |
| 2014 { | |
| 2015 *high = (uint8_t)((hardwareDataGetPointer()->production_year - 16) * 16); | |
| 2016 *high += hardwareDataGetPointer()->production_month; | |
| 2017 if(low) | |
| 2018 { | |
| 2019 *low = (uint8_t)(hardwareDataGetPointer()->production_day * 8); | |
| 2020 } | |
| 2021 } | |
| 2022 } | |
| 2023 | |
| 1058 | 2024 void firmwareVersionfrom16bit(uint8_t high16, uint8_t low16, uint8_t* fw_first, uint8_t* fw_second, uint8_t* fw_third) |
| 2025 { | |
| 2026 *fw_first = (high16 >> 3); | |
| 2027 *fw_second = ((high16 & 0x3) << 2) | (low16 >> 6); | |
| 2028 *fw_third = (low16 & 0x1F) >> 1; /* discard beta information */ | |
| 2029 } | |
| 38 | 2030 |
| 2031 uint8_t firmwareVersion_16bit_high(void) | |
| 2032 { | |
|
319
d8e86af78474
bugfix: correct packed main version number in dive header
Jan Mulder <jlmulder@xs4all.nl>
parents:
286
diff
changeset
|
2033 return ((firmware_FirmwareData.versionFirst & 0x1F) << 3) + ((firmware_FirmwareData.versionSecond & 0x1C) >> 2); |
| 38 | 2034 } |
| 2035 | |
| 2036 uint8_t firmwareVersion_16bit_low(void) | |
| 2037 { | |
| 2038 return ((firmware_FirmwareData.versionSecond & 0x03) << 6) + ((firmware_FirmwareData.versionThird & 0x1F) << 1) + (firmware_FirmwareData.versionBeta & 0x01); | |
| 2039 } | |
| 2040 | |
|
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:
324
diff
changeset
|
2041 inline SSettings* settingsGetPointer(void) |
| 38 | 2042 { |
| 2043 return &Settings; | |
| 2044 } | |
| 1027 | 2045 SSettings* profileGetPointer(uint8_t number) |
| 2046 { | |
| 2047 SSettings* returnPointer = NULL; | |
| 38 | 2048 |
| 1027 | 2049 if(number < NUMBER_OF_PROFILES) |
| 2050 { | |
| 2051 returnPointer = &Profile[number]; | |
| 2052 } | |
| 2053 | |
| 2054 return returnPointer; | |
| 2055 } | |
| 38 | 2056 |
| 2057 // =============================================================================== | |
| 2058 // set_settings_to_Standard | |
| 2059 /// @brief This function overwrites the current settings of the system | |
| 2060 /// with the EXCEPTION of the personalDiveCount | |
| 2061 /// | |
| 2062 /// It additionally calls set_new_settings_missing_in_ext_flash() and | |
| 2063 /// check_and_correct_settings(), even so this shouldn't be necessary. | |
| 2064 /// It is called on every start and from Reset All. | |
| 2065 /// | |
| 2066 /// 160622 added lastDiveLogIdBackup | |
| 2067 /// | |
| 2068 // =============================================================================== | |
| 1027 | 2069 void set_settings_to_Standard(uint8_t whichSettings) |
| 38 | 2070 { |
| 2071 SSettings *pSettings; | |
| 2072 const SSettings *pSettingsStandard; | |
| 2073 uint16_t personalDiveCountBackup; | |
| 2074 uint8_t lastDiveLogIdBackup; | |
| 997 | 2075 uint32_t sampleStartBackup; |
| 38 | 2076 pSettings = settingsGetPointer(); |
| 2077 pSettingsStandard = settingsGetPointerStandard(); | |
| 1027 | 2078 uint8_t profileBackup = pSettings->activeProfile; |
| 2079 | |
| 2080 switch(whichSettings) | |
| 2081 { | |
| 2082 default: | |
| 2083 case EF_SETTINGS: | |
| 2084 break; | |
| 2085 case EF_PROFILE0: pSettings = profileGetPointer(0); | |
| 2086 break; | |
| 2087 case EF_PROFILE1: pSettings = profileGetPointer(1); | |
| 2088 break; | |
| 2089 case EF_PROFILE2: pSettings = profileGetPointer(2); | |
| 2090 break; | |
| 2091 case EF_PROFILE3: pSettings = profileGetPointer(3); | |
| 2092 break; | |
| 2093 } | |
| 38 | 2094 |
| 2095 personalDiveCountBackup = pSettings->personalDiveCount; | |
| 2096 lastDiveLogIdBackup = pSettings->lastDiveLogId; | |
| 997 | 2097 sampleStartBackup = pSettings->logFlashNextSampleStartAddress; |
| 2098 | |
| 38 | 2099 memcpy(pSettings,pSettingsStandard,sizeof(*pSettings)); |
| 2100 pSettings->personalDiveCount = personalDiveCountBackup; | |
| 2101 pSettings->lastDiveLogId = lastDiveLogIdBackup; | |
| 997 | 2102 pSettings->logFlashNextSampleStartAddress = sampleStartBackup; |
| 38 | 2103 |
| 2104 pSettings->firmwareVersion[0] = firmware_FirmwareData.versionFirst; | |
| 2105 pSettings->firmwareVersion[1] = firmware_FirmwareData.versionSecond; | |
| 2106 pSettings->firmwareVersion[2] = firmware_FirmwareData.versionThird; | |
| 2107 pSettings->firmwareVersion[3] = firmware_FirmwareData.versionBeta; | |
| 2108 | |
| 997 | 2109 memset(pSettings->customtext,0,60); |
| 2110 sprintf(pSettings->customtext," <your name>\n <address>"); | |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
2111 pSettings->cv_configuration &= ~(1 << CVIEW_sensors | 1 << CVIEW_sensors_mV | 1 << CVIEW_Timer); |
| 997 | 2112 |
| 1027 | 2113 switch(whichSettings) /* some default data may be dependend on the default value => adapt setting */ |
| 2114 { | |
| 2115 default: | |
| 2116 case EF_SETTINGS: pSettings->activeProfile = profileBackup; | |
| 2117 break; | |
| 2118 case EF_PROFILE0: pSettings = profileGetPointer(0); | |
| 2119 break; | |
| 2120 case EF_PROFILE1: pSettings = profileGetPointer(1); | |
| 2121 break; | |
| 2122 case EF_PROFILE2: pSettings = profileGetPointer(2); /* MCCR */ | |
| 2123 pSettings->dive_mode = DIVEMODE_CCR; | |
| 2124 break; | |
| 2125 case EF_PROFILE3: pSettings = profileGetPointer(3); /* ECCR */ | |
| 2126 pSettings->dive_mode = DIVEMODE_CCR; | |
| 2127 pSettings->CCR_Mode = CCRMODE_Sensors; | |
| 2128 break; | |
| 2129 } | |
| 2130 | |
| 2131 set_new_settings_missing_in_ext_flash(whichSettings); | |
| 2132 check_and_correct_settings(whichSettings); | |
| 38 | 2133 // has to be called too: createDiveSettings(); |
| 2134 } | |
| 2135 | |
| 2136 | |
| 2137 // =============================================================================== | |
| 2138 // mod_settings_for_first_start_with_empty_ext_flash | |
| 2139 /// @brief This function overwrites some settings of the system | |
| 2140 /// It is called on every start. | |
| 2141 /// Those settings will be overwriten by ext_flash_read_settings() | |
| 2142 /// Will be kept if ext_flash_read_settings() is invalid because | |
| 2143 /// it is still empty. | |
| 2144 /// | |
| 2145 // =============================================================================== | |
| 2146 void mod_settings_for_first_start_with_empty_ext_flash(void) | |
| 2147 { | |
| 2148 settingsGetPointer()->debugModeOnStart = 1; // | |
| 2149 } | |
| 2150 | |
| 2151 | |
| 2152 | |
| 2153 // =============================================================================== | |
| 2154 // hwOS4_to_hwOS_GasType | |
| 2155 /// @brief Helper for get gas / diluent | |
| 2156 /// | |
| 2157 // =============================================================================== | |
| 2158 uint8_t hwOS4_to_hwOS_GasType(uint8_t inOSTC4style) | |
| 2159 { | |
| 2160 switch(inOSTC4style) | |
| 2161 { | |
| 2162 case (1+2): // first | |
| 2163 case (2): // first | |
| 2164 return 1; // hwOS style first | |
| 2165 case (1+4): // deco | |
| 2166 case (4): // deco | |
| 2167 return 3; // hwOS style deco | |
| 2168 case (1+8): // travel | |
| 2169 case (8): // travel | |
| 2170 return 2; // hwOS style travel | |
| 2171 default: | |
| 2172 return 0; // hwOS style Disabled | |
| 2173 } | |
| 2174 } | |
| 2175 | |
| 2176 | |
| 2177 // =============================================================================== | |
| 2178 // hwOS_to_hwOS4_GasType | |
| 2179 /// @brief Helper for set gas / diluent | |
| 2180 /// | |
| 2181 // =============================================================================== | |
| 2182 uint8_t hwOS_to_hwOS4_GasType(uint8_t inOSTC4style) | |
| 2183 { | |
| 2184 switch(inOSTC4style) | |
| 2185 { | |
| 2186 case (1): // first | |
| 2187 return 1+2; // hwOS4 style first | |
| 2188 case (2): // travel (normal for diluent) | |
| 2189 return 1+8; // hwOS4 style travel | |
| 2190 case (3): // deco | |
| 2191 return 1+4; // hwOS4 style deco | |
| 2192 default: | |
| 2193 return 0; // hwOS4 style inactive | |
| 2194 } | |
| 2195 } | |
| 2196 | |
| 2197 | |
| 2198 | |
| 2199 // =============================================================================== | |
| 2200 // setGas | |
| 2201 /// @brief This function overwrites one gas, including mode and deco depth, | |
| 2202 /// it returns 0x4D prompt which is not used by writeData() that calls it. | |
| 2203 /// | |
| 2204 /// @param i the gas id from 1 to 5 for OC and 6 to 10 for CCR, 0 is the extra gas | |
| 2205 /// @param *data 5 bytes with the first the command to call setGas and the four | |
| 2206 /// following bytes to define oxygen, helium, mode and deco depth | |
| 2207 /// | |
| 2208 /// @return 0x4D (prompt that is not used) | |
| 2209 // =============================================================================== | |
| 2210 uint8_t setGas(int i,uint8_t * data) | |
| 2211 { | |
| 2212 if(!checkValue(data[1],4,100)) | |
| 2213 return ERROR_; | |
| 2214 if(!checkValue(data[4],0,250)) | |
| 2215 return ERROR_; | |
| 2216 | |
| 2217 Settings.gas[i].oxygen_percentage = data[1]; | |
| 2218 Settings.gas[i].helium_percentage = data[2]; | |
| 2219 Settings.gas[i].note.uw = hwOS_to_hwOS4_GasType(data[3]); | |
| 2220 Settings.gas[i].depth_meter = data[4]; | |
| 2221 return 0x4d; | |
| 2222 } | |
| 2223 | |
| 2224 | |
| 2225 uint8_t getGas(int i,uint8_t * data) | |
| 2226 { | |
| 2227 data[0] = Settings.gas[i].oxygen_percentage; | |
| 2228 data[1] = Settings.gas[i].helium_percentage; | |
| 2229 data[2] = hwOS4_to_hwOS_GasType(Settings.gas[i].note.uw); | |
| 2230 data[3] = Settings.gas[i].depth_meter; | |
| 2231 return 0x4d; | |
| 2232 } | |
| 2233 | |
| 2234 uint8_t setDiluent(int i,uint8_t * data) | |
| 2235 { | |
| 2236 if(!checkValue(data[1],4,100)) | |
| 2237 return ERROR_; | |
| 2238 if(!checkValue(data[4],0,250)) | |
| 2239 return ERROR_; | |
| 2240 | |
| 2241 Settings.gas[NUM_OFFSET_DILUENT + i].oxygen_percentage = data[1]; | |
| 2242 Settings.gas[NUM_OFFSET_DILUENT + i].helium_percentage = data[2]; | |
| 2243 Settings.gas[NUM_OFFSET_DILUENT + i].note.uw = hwOS_to_hwOS4_GasType(data[3]); | |
| 2244 Settings.gas[NUM_OFFSET_DILUENT + i].depth_meter = data[4]; | |
| 2245 return 0x4d; | |
| 2246 } | |
| 2247 | |
| 2248 uint8_t getDiluent(int i,uint8_t * data) | |
| 2249 { | |
| 2250 data[0] = Settings.gas[NUM_OFFSET_DILUENT + i].oxygen_percentage; | |
| 2251 data[1] = Settings.gas[NUM_OFFSET_DILUENT + i].helium_percentage; | |
| 2252 data[2] = hwOS4_to_hwOS_GasType(Settings.gas[NUM_OFFSET_DILUENT + i].note.uw); | |
| 2253 data[3] = Settings.gas[NUM_OFFSET_DILUENT + i].depth_meter; | |
| 2254 return 0x4d; | |
| 2255 } | |
| 2256 | |
| 2257 uint8_t setSetpoint(int i,uint8_t * data) | |
| 2258 { | |
| 2259 if(!checkValue(data[1],50,160)) | |
| 2260 return ERROR_; | |
| 2261 if(!checkValue(data[2],0,250)) | |
| 2262 return ERROR_; | |
| 2263 | |
| 2264 Settings.setpoint[i].setpoint_cbar = data[1]; | |
| 2265 Settings.setpoint[i].depth_meter = data[2]; | |
| 2266 return 0x4d; | |
| 2267 } | |
| 2268 | |
| 2269 uint8_t getSetpoint(int i,uint8_t * data) | |
| 2270 { | |
| 2271 data[0] = Settings.setpoint[i].setpoint_cbar; | |
| 2272 data[1] = Settings.setpoint[i].depth_meter; | |
| 2273 return 0x4d; | |
| 2274 } | |
| 2275 | |
| 2276 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to) | |
| 2277 { | |
| 2278 if(value >= from && value <= to) | |
| 2279 return 1; | |
| 2280 return 0; | |
| 2281 } | |
| 2282 | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2283 bool checkValueSigned(int8_t value, int8_t from, int8_t to) |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2284 { |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2285 if(value >= from && value <= to) |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2286 return true; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2287 return false; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2288 } |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2289 |
| 38 | 2290 uint8_t writeData(uint8_t * data) |
| 2291 { | |
| 2292 uint32_t newSensitivity; | |
| 2293 uint16_t newDuration, newOffset; | |
| 2294 uint8_t newStopDepth; | |
| 2295 | |
| 2296 switch(data[0]) | |
| 2297 { | |
| 2298 case 0x10: | |
| 2299 return setGas(1,data); | |
| 2300 case 0x11: | |
| 2301 return setGas(2,data); | |
| 2302 case 0x12: | |
| 2303 return setGas(3,data); | |
| 2304 case 0x13: | |
| 2305 return setGas(4,data); | |
| 2306 case 0x14: | |
| 2307 return setGas(5,data); | |
| 2308 case 0x15: | |
| 2309 return setDiluent(1,data); | |
| 2310 case 0x16: | |
| 2311 return setDiluent(2,data); | |
| 2312 case 0x17: | |
| 2313 return setDiluent(3,data); | |
| 2314 case 0x18: | |
| 2315 return setDiluent(4,data); | |
| 2316 case 0x19: | |
| 2317 return setDiluent(5,data); | |
| 2318 case 0x1A: | |
| 2319 return setSetpoint(1,data); | |
| 2320 case 0x1B: | |
| 2321 return setSetpoint(2,data); | |
| 2322 case 0x1C: | |
| 2323 return setSetpoint(3,data); | |
| 2324 case 0x1D: | |
| 2325 return setSetpoint(4,data); | |
| 2326 case 0x1E: | |
| 2327 return setSetpoint(5,data); | |
| 2328 case 0x1F: | |
| 2329 if(!checkValue(data[2],0,1)) | |
| 2330 return ERROR_; | |
| 2331 Settings.CCR_Mode = data[1]; | |
| 2332 break; | |
| 2333 case 0x20: | |
| 2334 if(!checkValue(data[1],0,3)) | |
| 2335 return ERROR_; | |
| 2336 Settings.dive_mode = data[1]; | |
| 2337 break; | |
| 2338 case 0x21: | |
| 2339 if(!checkValue(data[1],1,2)) | |
| 2340 return ERROR_; | |
| 2341 Settings.deco_type.ub.standard = data[1] & 0x0F; | |
| 2342 //Settings.deco_type.ub.alternative = (data[1] & 0xF0) >> 4; | |
| 2343 break; | |
| 2344 case 0x22: | |
| 2345 if(!checkValue(data[1],100,190)) | |
| 2346 return ERROR_; | |
| 2347 Settings.ppO2_max_std = data[1]; | |
| 2348 break; | |
| 2349 case 0x23: | |
| 2350 if(!checkValue(data[1],15,15)) | |
| 2351 return ERROR_; | |
| 2352 Settings.ppO2_min = data[1]; | |
| 2353 break; | |
| 2354 case 0x24: | |
| 2355 if(!checkValue(data[1],0,15)) | |
| 2356 return ERROR_; | |
| 2357 Settings.future_TTS = data[1]; | |
| 2358 break; | |
| 2359 case 0x25: | |
| 2360 if(!checkValue(data[1],10,99)) | |
| 2361 return ERROR_; | |
| 2362 Settings.GF_low = data[1]; | |
| 2363 break; | |
| 2364 case 0x26: | |
| 2365 if(!checkValue(data[1],45,99)) | |
| 2366 return ERROR_; | |
| 2367 Settings.GF_high = data[1]; | |
| 2368 break; | |
| 2369 case 0x27: | |
| 2370 if(!checkValue(data[1],10,99)) | |
| 2371 return ERROR_; | |
| 2372 Settings.aGF_low = data[1]; | |
| 2373 break; | |
| 2374 case 0x28: | |
| 2375 if(!checkValue(data[1],45,99)) | |
| 2376 return ERROR_; | |
| 2377 Settings.aGF_high = data[1]; | |
| 2378 break; | |
| 2379 case 0x29: | |
| 2380 if(!checkValue(data[1],0,5)) | |
| 2381 return ERROR_; | |
| 2382 Settings.VPM_conservatism.ub.standard = data[1]; | |
| 2383 break; | |
| 2384 case 0x2A: | |
| 2385 case 0x2B: | |
| 2386 return ERROR_; | |
| 2387 case 0x2C: | |
| 2388 if(!checkValue(data[1],3,9)) | |
| 2389 return ERROR_; | |
| 2390 Settings.last_stop_depth_meter = data[1]; | |
| 2391 break; | |
| 2392 case 0x2D: | |
| 2393 if(!checkValue(data[1],0,4)) | |
| 2394 return ERROR_; | |
| 2395 Settings.brightness = data[1]; | |
| 2396 break; | |
| 2397 case 0x2E: | |
| 2398 if(!checkValue(data[1],0,1)) | |
| 2399 return ERROR_; | |
| 2400 Settings.nonMetricalSystem = data[1]; | |
| 2401 break; | |
| 2402 case 0x2F: | |
| 2403 return ERROR_; | |
| 2404 case 0x30: | |
| 2405 if(!checkValue(data[1],0,4)) | |
| 2406 return ERROR_; | |
| 2407 Settings.salinity = data[1]; | |
| 2408 break; | |
| 2409 case 0x31: | |
| 2410 if(!checkValue(data[1],0,3)) | |
| 2411 return ERROR_; | |
| 2412 Settings.tX_colorscheme = data[1]; | |
| 2413 GFX_use_colorscheme(Settings.tX_colorscheme); | |
| 2414 break; | |
| 2415 case 0x32: | |
| 2416 if(!checkValue(data[1],0,4)) | |
| 2417 return ERROR_; | |
| 2418 Settings.selected_language = data[1]; | |
| 2419 break; | |
| 2420 case 0x33: | |
| 2421 if(!checkValue(data[1],0,2)) | |
| 2422 return ERROR_; | |
| 2423 Settings.date_format = data[1]; | |
| 2424 break; | |
| 2425 case 0x34: | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2426 if (!checkValueSigned(data[1], -MAX_COMPASS_DECLINATION_DEG, MAX_COMPASS_DECLINATION_DEG)) |
| 38 | 2427 return ERROR_; |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2428 Settings.compassDeclinationDeg = (int8_t)data[1]; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2429 |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2430 break; |
| 38 | 2431 case 0x35: |
| 2432 if(data[1] & 0x80) | |
| 2433 { | |
| 2434 data[1] = ~(data[1]); | |
|
337
38367bb982b8
Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents:
334
diff
changeset
|
2435 if(!checkValue(data[1],0,PRESSURE_OFFSET_LIMIT_MBAR)) |
| 38 | 2436 return ERROR_; |
| 2437 Settings.offsetPressure_mbar = 0 - data[1]; | |
| 2438 } | |
| 2439 else | |
| 2440 { | |
|
337
38367bb982b8
Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents:
334
diff
changeset
|
2441 if(!checkValue(data[1],0,PRESSURE_OFFSET_LIMIT_MBAR)) |
| 38 | 2442 return ERROR_; |
| 2443 Settings.offsetPressure_mbar = data[1]; | |
| 2444 } | |
| 2445 break; | |
| 2446 case 0x36: | |
| 2447 if(!checkValue(data[1],0,1)) | |
| 2448 return ERROR_; | |
| 2449 if(data[1]) | |
| 2450 Settings.safetystopDuration = settingsGetPointerStandard()->safetystopDuration; | |
| 2451 else | |
| 2452 Settings.safetystopDuration = 0; | |
| 2453 break; | |
| 2454 case 0x37: | |
| 2455 return ERROR_; | |
| 2456 case 0x38: | |
| 2457 if(!checkValue(data[1],0,1)) | |
| 2458 return ERROR_; | |
| 2459 Settings.fallbackToFixedSetpoint = data[1]; | |
| 2460 break; | |
| 2461 case 0x39: | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2462 if (!checkValue(data[1], 0, 1)) |
| 38 | 2463 return ERROR_; |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2464 setFlipDisplay(data[1]); |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2465 |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2466 break; |
| 38 | 2467 case 0x3A: |
| 2468 if(!checkValue(data[1],70,110)) | |
| 2469 return ERROR_; | |
| 2470 newSensitivity = data[1]; | |
| 2471 settingsHelperButtonSens_keepPercentageValues(newSensitivity, settingsGetPointer()->ButtonResponsiveness); | |
| 2472 setButtonResponsiveness(Settings.ButtonResponsiveness); | |
| 2473 break; | |
| 2474 case 0x3B: | |
| 2475 // value between 0 and 127 | |
| 2476 if(buttonBalanceTranslatorHexToArray(data[1], settingsGetPointer()->buttonBalance)) | |
| 2477 { | |
| 2478 settingsHelperButtonSens_keepPercentageValues(settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->ButtonResponsiveness); | |
| 2479 } | |
| 2480 else // value >= 128 (bit 7 set) factory reset | |
| 2481 { | |
| 2482 getButtonFactorDefaults(&settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->buttonBalance); | |
| 2483 settingsHelperButtonSens_keepPercentageValues(settingsGetPointerStandard()->ButtonResponsiveness[3], settingsGetPointer()->ButtonResponsiveness); | |
| 2484 } | |
| 2485 // valid for both: | |
| 2486 setButtonResponsiveness(Settings.ButtonResponsiveness); | |
| 2487 break; | |
| 2488 case 0x3C: | |
| 2489 if(!checkValue(data[1],5,50)) | |
| 2490 return ERROR_; | |
| 2491 Settings.gasConsumption_bottom_l_min = data[1]; | |
| 2492 break; | |
| 2493 case 0x3D: | |
| 2494 if(!checkValue(data[1],5,50)) | |
| 2495 return ERROR_; | |
| 2496 Settings.gasConsumption_deco_l_min = data[1]; | |
| 2497 break; | |
| 2498 case 0x3E: | |
| 2499 if(!checkValue(data[1],5,50)) | |
| 2500 return ERROR_; | |
| 2501 Settings.gasConsumption_travel_l_min = data[1]; | |
| 2502 break; | |
| 2503 case 0x3F: | |
| 2504 case 0x40: | |
| 2505 return ERROR_; | |
| 2506 case 0x41: | |
| 2507 if(!checkValue(data[1],0,1)) | |
| 2508 return ERROR_; | |
| 2509 Settings.alwaysShowPPO2 = data[1]; | |
| 2510 break; | |
| 2511 case 0x42: | |
| 2512 if(data[1] & 0x80) | |
| 2513 { | |
| 2514 data[1] = ~(data[1]); | |
| 2515 if(!checkValue(data[1],0,20)) | |
| 2516 return ERROR_; | |
| 2517 Settings.offsetTemperature_centigrad = 0 - data[1]; | |
| 2518 } | |
| 2519 else | |
| 2520 { | |
| 2521 if(!checkValue(data[1],0,20)) | |
| 2522 return ERROR_; | |
| 2523 Settings.offsetTemperature_centigrad = data[1]; | |
| 2524 } | |
| 2525 break; | |
| 2526 case 0x43: | |
| 2527 if(!checkValue(data[1],60,255)) | |
| 2528 return ERROR_; | |
| 2529 newDuration = (uint16_t)data[1] + 59; | |
| 2530 newDuration /= 60; | |
| 2531 Settings.safetystopDuration = (uint8_t)newDuration; | |
| 2532 break; | |
| 2533 case 0x44: | |
| 2534 if(!checkValue(data[1],21,61)) | |
| 2535 return ERROR_; | |
| 2536 newStopDepth = data[1] + 9; | |
| 2537 if(newStopDepth > 60) | |
| 2538 newStopDepth = 60; | |
| 2539 newStopDepth /= 10; | |
| 2540 Settings.safetystopDepth = newStopDepth; | |
| 2541 break; | |
| 2542 case 0x45: | |
| 2543 case 0x46: | |
| 2544 return ERROR_; | |
| 2545 case 0x47: | |
| 2546 newOffset = data[2] * 256; | |
| 2547 newOffset += data[1]; | |
| 2548 if(newOffset > 9000) | |
| 2549 return ERROR_; | |
| 2550 Settings.logbookOffset = newOffset; | |
| 2551 break; | |
| 2552 case 0x70: | |
| 2553 if(!checkValue(data[1],0,1)) | |
| 2554 return ERROR_; | |
| 2555 Settings.showDebugInfo = data[1]; | |
| 2556 break; | |
| 2557 case 0x71: | |
| 2558 if(!checkValue(data[1],0,(EXTRADISPLAY_END - 1))) | |
| 2559 return ERROR_; | |
| 2560 Settings.extraDisplay = data[1]; | |
| 2561 break; | |
| 2562 case 0x72: | |
| 2563 if(!checkValue(data[1],0,8)) | |
| 2564 return ERROR_; | |
| 2565 Settings.tX_customViewPrimary = data[1]; | |
| 2566 break; | |
| 2567 case 0x73: | |
| 2568 if(!checkValue(data[1],0,20)) | |
| 2569 return ERROR_; | |
| 2570 Settings.tX_customViewTimeout = data[1]; | |
| 2571 break; | |
| 2572 case 0x74: | |
| 2573 if(!checkValue(data[1],1,7)) | |
| 2574 return ERROR_; | |
| 2575 Settings.tX_userselectedLeftLowerCornerPrimary = data[1]; | |
| 2576 break; | |
| 2577 case 0x75: | |
| 2578 if(!checkValue(data[1],0,20)) | |
| 2579 return ERROR_; | |
| 2580 Settings.tX_userselectedLeftLowerCornerTimeout = data[1]; | |
| 2581 break; | |
| 2582 } | |
| 2583 return 0; | |
| 2584 } | |
| 2585 | |
| 2586 | |
| 2587 uint8_t readDataLimits__8and16BitValues_4and7BytesOutput(uint8_t what, uint8_t * data) | |
| 2588 { | |
| 2589 enum JeanDoParameterType { | |
| 2590 PARAM_UNKNOWN = 0, | |
| 2591 PARAM_INT15 = 1, | |
| 2592 PARAM_INT8, | |
| 2593 PARAM_DECI, | |
| 2594 PARAM_CENTI, | |
| 2595 PARAM_MILI, | |
| 2596 PARAM_PERCENT, | |
| 2597 PARAM_SEC, | |
| 2598 PARAM_COLOR, | |
| 2599 PARAM_BOOL, | |
| 2600 PARAM_ENUM, | |
| 2601 PARAM_SIGNED = 128, | |
| 2602 PARAM_SDECI = PARAM_SIGNED|PARAM_DECI, | |
| 2603 PARAM_SSEC = PARAM_SIGNED|PARAM_SEC, | |
| 2604 PARAM_SINT = PARAM_SIGNED|PARAM_INT8 | |
| 2605 }; | |
| 2606 | |
| 2607 // uint32_t buttonSensitivity; | |
| 2608 uint16_t newDuration; | |
| 2609 | |
| 2610 uint8_t datacounter = 0; | |
| 2611 | |
| 2612 data[0] = 0; | |
| 2613 data[1] = 0; | |
| 2614 data[2] = 0; | |
| 2615 data[3] = 0; | |
| 2616 datacounter = 0; | |
| 2617 | |
| 2618 switch(what) | |
| 2619 { | |
| 2620 case 0x10: | |
| 2621 case 0x11: | |
| 2622 case 0x12: | |
| 2623 case 0x13: | |
| 2624 case 0x14: | |
| 2625 data[datacounter++] = PARAM_INT8; | |
| 2626 data[datacounter++] = 4; | |
| 2627 data[datacounter++] = settingsGetPointerStandard()->gas[1].oxygen_percentage; | |
| 2628 data[datacounter++] = 100; | |
| 2629 break; | |
| 2630 | |
| 2631 case 0x15: | |
| 2632 case 0x16: | |
| 2633 case 0x17: | |
| 2634 case 0x18: | |
| 2635 case 0x19: | |
| 2636 data[datacounter++] = PARAM_INT8; | |
| 2637 data[datacounter++] = 4; | |
| 2638 data[datacounter++] = settingsGetPointerStandard()->gas[1].oxygen_percentage; | |
| 2639 data[datacounter++] = 100; | |
| 2640 break; | |
| 2641 | |
| 2642 case 0x1A: | |
| 2643 case 0x1B: | |
| 2644 case 0x1C: | |
| 2645 case 0x1D: | |
| 2646 case 0x1E: | |
| 2647 data[datacounter++] = PARAM_CENTI; | |
| 2648 data[datacounter++] = 50; | |
| 2649 data[datacounter++] = settingsGetPointerStandard()->setpoint[1].setpoint_cbar; | |
| 2650 data[datacounter++] = 160; | |
| 2651 break; | |
| 2652 | |
| 2653 case 0x1F: | |
| 2654 data[datacounter++] = PARAM_ENUM; | |
| 2655 data[datacounter++] = 0; | |
| 2656 data[datacounter++] = settingsGetPointerStandard()->CCR_Mode; | |
| 2657 data[datacounter++] = 1; | |
| 2658 break; | |
| 2659 | |
| 2660 case 0x20: | |
| 2661 data[datacounter++] = PARAM_ENUM; | |
| 2662 data[datacounter++] = 0; | |
| 2663 data[datacounter++] = settingsGetPointerStandard()->dive_mode; | |
| 2664 data[datacounter++] = 3; | |
| 2665 break; | |
| 2666 | |
| 2667 case 0x21: | |
| 2668 data[datacounter++] = PARAM_ENUM; | |
| 2669 data[datacounter++] = 1; | |
| 2670 data[datacounter++] = settingsGetPointerStandard()->deco_type.ub.standard; | |
| 2671 data[datacounter++] = 2; | |
| 2672 break; | |
| 2673 | |
| 2674 case 0x22: | |
| 2675 data[datacounter++] = PARAM_CENTI; | |
| 2676 data[datacounter++] = 100; | |
| 2677 data[datacounter++] = settingsGetPointerStandard()->ppO2_max_std; | |
| 2678 data[datacounter++] = 190; | |
| 2679 break; | |
| 2680 | |
| 2681 case 0x23: | |
| 2682 data[datacounter++] = PARAM_CENTI; | |
| 2683 data[datacounter++] = 15; | |
| 2684 data[datacounter++] = settingsGetPointerStandard()->ppO2_min; | |
| 2685 data[datacounter++] = 15; | |
| 2686 break; | |
| 2687 | |
| 2688 case 0x24: | |
| 2689 data[datacounter++] = PARAM_INT8; // minutes | |
| 2690 data[datacounter++] = 0; | |
| 2691 data[datacounter++] = settingsGetPointerStandard()->future_TTS; | |
| 2692 data[datacounter++] = 15; | |
| 2693 break; | |
| 2694 | |
| 2695 case 0x25: | |
| 2696 data[datacounter++] = PARAM_PERCENT; | |
| 2697 data[datacounter++] = 10; | |
| 2698 data[datacounter++] = settingsGetPointerStandard()->GF_low; | |
| 2699 data[datacounter++] = 99; | |
| 2700 break; | |
| 2701 | |
| 2702 case 0x26: | |
| 2703 data[datacounter++] = PARAM_PERCENT; | |
| 2704 data[datacounter++] = 45; | |
| 2705 data[datacounter++] = settingsGetPointerStandard()->GF_high; | |
| 2706 data[datacounter++] = 99; | |
| 2707 break; | |
| 2708 | |
| 2709 case 0x27: | |
| 2710 data[datacounter++] = PARAM_PERCENT; | |
| 2711 data[datacounter++] = 10; | |
| 2712 data[datacounter++] = settingsGetPointerStandard()->aGF_low; | |
| 2713 data[datacounter++] = 99; | |
| 2714 break; | |
| 2715 | |
| 2716 case 0x28: | |
| 2717 data[datacounter++] = PARAM_PERCENT; | |
| 2718 data[datacounter++] = 45; | |
| 2719 data[datacounter++] = settingsGetPointerStandard()->aGF_high; | |
| 2720 data[datacounter++] = 99; | |
| 2721 break; | |
| 2722 | |
| 2723 case 0x29: | |
| 2724 data[datacounter++] = PARAM_INT8; // conservatism +0 .. +5 | |
| 2725 data[datacounter++] = 0; | |
| 2726 data[datacounter++] = settingsGetPointerStandard()->VPM_conservatism.ub.standard; | |
| 2727 data[datacounter++] = 5; | |
| 2728 break; | |
| 2729 | |
| 2730 case 0x2A: | |
| 2731 case 0x2B: | |
| 2732 data[datacounter++] = PARAM_PERCENT; | |
| 2733 data[datacounter++] = 100; | |
| 2734 data[datacounter++] = 100;// saturation, desaturation, settingsGetPointerStandard()->; | |
| 2735 data[datacounter++] = 100; | |
| 2736 break; | |
| 2737 | |
| 2738 case 0x2C: | |
| 2739 data[datacounter++] = PARAM_INT8; | |
| 2740 data[datacounter++] = 3; | |
| 2741 data[datacounter++] = settingsGetPointerStandard()->last_stop_depth_meter; | |
| 2742 data[datacounter++] = 9; | |
| 2743 break; | |
| 2744 | |
| 2745 case 0x2D: | |
| 2746 data[datacounter++] = PARAM_ENUM; | |
| 2747 data[datacounter++] = 0; | |
| 2748 data[datacounter++] = settingsGetPointerStandard()->brightness; | |
| 2749 data[datacounter++] = 4; | |
| 2750 break; | |
| 2751 | |
| 2752 case 0x2E: | |
| 2753 data[datacounter++] = PARAM_ENUM; | |
| 2754 data[datacounter++] = 0; | |
| 2755 data[datacounter++] = settingsGetPointerStandard()->nonMetricalSystem; | |
| 2756 data[datacounter++] = 1; | |
| 2757 break; | |
| 2758 | |
| 2759 case 0x2F: | |
| 2760 data[datacounter++] = PARAM_INT8; // Sampling rate logbook | |
| 2761 data[datacounter++] = 2; | |
| 2762 data[datacounter++] = 2; | |
| 2763 data[datacounter++] = 2; | |
| 2764 break; | |
| 2765 | |
| 2766 case 0x30: | |
| 2767 data[datacounter++] = PARAM_PERCENT; | |
| 2768 data[datacounter++] = 0; | |
| 2769 data[datacounter++] = settingsGetPointerStandard()->salinity; | |
| 2770 data[datacounter++] = 4; | |
| 2771 break; | |
| 2772 | |
| 2773 case 0x31: | |
| 2774 data[datacounter++] = PARAM_INT8; | |
| 2775 data[datacounter++] = 0; | |
| 2776 data[datacounter++] = settingsGetPointerStandard()->tX_colorscheme; | |
| 2777 data[datacounter++] = 3; | |
| 2778 break; | |
| 2779 | |
| 2780 case 0x32: | |
| 2781 data[datacounter++] = PARAM_ENUM; | |
| 2782 data[datacounter++] = 0; | |
| 2783 data[datacounter++] = settingsGetPointerStandard()->selected_language; | |
| 2784 data[datacounter++] = 1; | |
| 2785 break; | |
| 2786 | |
| 2787 case 0x33: | |
| 2788 data[datacounter++] = PARAM_ENUM; | |
| 2789 data[datacounter++] = 0; | |
| 2790 data[datacounter++] = settingsGetPointerStandard()->date_format; | |
| 2791 data[datacounter++] = 2; | |
| 2792 break; | |
| 2793 | |
| 2794 case 0x34: | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2795 data[datacounter++] = PARAM_SINT; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2796 data[datacounter++] = (uint8_t)-MAX_COMPASS_DECLINATION_DEG; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2797 data[datacounter++] = (uint8_t)settingsGetPointerStandard()->compassDeclinationDeg; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2798 data[datacounter++] = MAX_COMPASS_DECLINATION_DEG; |
| 38 | 2799 break; |
| 2800 | |
| 2801 case 0x35: | |
| 2802 data[datacounter++] = PARAM_SINT; | |
|
337
38367bb982b8
Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents:
334
diff
changeset
|
2803 data[datacounter++] = (uint8_t)(256 - PRESSURE_OFFSET_LIMIT_MBAR); // == -20 |
| 38 | 2804 if(settingsGetPointerStandard()->offsetPressure_mbar < 0) |
| 2805 data[datacounter++] = (uint8_t)(127 - settingsGetPointerStandard()->offsetPressure_mbar); | |
| 2806 else | |
| 2807 data[datacounter++] = settingsGetPointerStandard()->offsetPressure_mbar; | |
|
337
38367bb982b8
Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents:
334
diff
changeset
|
2808 data[datacounter++] = PRESSURE_OFFSET_LIMIT_MBAR; |
| 38 | 2809 break; |
| 2810 | |
| 2811 case 0x36: | |
| 2812 data[datacounter++] = PARAM_BOOL; | |
| 2813 data[datacounter++] = 0; | |
| 2814 if(settingsGetPointerStandard()->safetystopDuration) | |
| 2815 data[datacounter++] = 1; | |
| 2816 else | |
| 2817 data[datacounter++] = 0; | |
| 2818 data[datacounter++] = 1; | |
| 2819 break; | |
| 2820 | |
| 2821 case 0x37: | |
| 2822 data[datacounter++] = PARAM_UNKNOWN ; | |
| 2823 data[datacounter++] = 0; | |
| 2824 data[datacounter++] = 0; // Set calibration gas, not possible with optical | |
| 2825 data[datacounter++] = 0; | |
| 2826 break; | |
| 2827 | |
| 2828 case 0x38: | |
| 2829 data[datacounter++] = PARAM_BOOL; | |
| 2830 data[datacounter++] = 0; | |
| 2831 data[datacounter++] = settingsGetPointerStandard()->fallbackToFixedSetpoint; | |
| 2832 data[datacounter++] = 1; | |
| 2833 break; | |
| 2834 | |
| 2835 case 0x39: | |
| 2836 data[datacounter++] = PARAM_BOOL; | |
| 2837 data[datacounter++] = 0; | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2838 data[datacounter++] = settingsGetPointerStandard()->FlipDisplay; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2839 data[datacounter++] = 1; |
| 38 | 2840 break; |
| 2841 | |
| 2842 case 0x3A: | |
| 2843 data[datacounter++] = PARAM_PERCENT; | |
| 2844 data[datacounter++] = 70; | |
| 2845 data[datacounter++] = settingsGetPointerStandard()->ButtonResponsiveness[3]; | |
| 2846 data[datacounter++] = 110; | |
| 2847 break; | |
| 2848 | |
| 2849 case 0x3B: | |
| 2850 data[datacounter++] = PARAM_UNKNOWN; | |
| 2851 data[datacounter++] = 0; | |
| 2852 data[datacounter++] = buttonBalanceTranslateArrayOutHex(settingsGetPointerStandard()->buttonBalance); | |
| 2853 data[datacounter++] = 128; | |
| 2854 break; | |
| 2855 | |
| 2856 case 0x3C: | |
| 2857 data[datacounter++] = PARAM_INT8; | |
| 2858 data[datacounter++] = 5; | |
| 2859 data[datacounter++] = settingsGetPointerStandard()->gasConsumption_bottom_l_min; | |
| 2860 data[datacounter++] = 50; | |
| 2861 break; | |
| 2862 | |
| 2863 case 0x3D: | |
| 2864 data[datacounter++] = PARAM_INT8; | |
| 2865 data[datacounter++] = 5; | |
| 2866 data[datacounter++] = settingsGetPointerStandard()->gasConsumption_deco_l_min; | |
| 2867 data[datacounter++] = 50; | |
| 2868 break; | |
| 2869 | |
| 2870 case 0x3E: | |
| 2871 data[datacounter++] = PARAM_INT8; | |
| 2872 data[datacounter++] = 5; | |
| 2873 data[datacounter++] = settingsGetPointerStandard()->gasConsumption_travel_l_min; | |
| 2874 data[datacounter++] = 50; | |
| 2875 break; | |
| 2876 | |
| 2877 case 0x3F: | |
| 2878 data[datacounter++] = PARAM_UNKNOWN; | |
| 2879 data[datacounter++] = 0; | |
| 2880 data[datacounter++] = 0; // Dynamic ascend rate, not yet :-) settingsGetPointerStandard()->; | |
| 2881 data[datacounter++] = 0; | |
| 2882 break; | |
| 2883 | |
| 2884 case 0x40: | |
| 2885 data[datacounter++] = PARAM_BOOL; | |
| 2886 data[datacounter++] = 1; | |
| 2887 data[datacounter++] = 1; // Graphical speed indicator; | |
| 2888 data[datacounter++] = 1; | |
| 2889 break; | |
| 2890 | |
| 2891 case 0x41: | |
| 2892 data[datacounter++] = PARAM_BOOL; | |
| 2893 data[datacounter++] = 0; | |
| 2894 data[datacounter++] = settingsGetPointerStandard()->alwaysShowPPO2; | |
| 2895 data[datacounter++] = 1; | |
| 2896 break; | |
| 2897 | |
| 2898 case 0x42: | |
| 2899 data[datacounter++] = PARAM_SIGNED|PARAM_CENTI; | |
| 2900 data[datacounter++] = (uint8_t)(256 - 20); // == -20 | |
| 2901 if(settingsGetPointerStandard()->offsetTemperature_centigrad < 0) | |
| 2902 data[datacounter++] = (uint8_t)(127 - settingsGetPointerStandard()->offsetTemperature_centigrad); | |
| 2903 else | |
| 2904 data[datacounter++] = settingsGetPointerStandard()->offsetTemperature_centigrad; | |
| 2905 data[datacounter++] = 20; | |
| 2906 break; | |
| 2907 | |
| 2908 case 0x43: | |
| 2909 newDuration = settingsGetPointerStandard()->safetystopDuration; | |
| 2910 newDuration *= 60; | |
| 2911 if(newDuration > 255) | |
| 2912 newDuration = 255; | |
| 2913 data[datacounter++] = PARAM_INT8; | |
| 2914 data[datacounter++] = 60; // coud be 1 minute instead | |
| 2915 data[datacounter++] = (uint8_t)newDuration; | |
| 2916 data[datacounter++] = 255; // could be 5 minutes instead | |
| 2917 break; | |
| 2918 | |
| 2919 case 0x44: | |
| 2920 data[datacounter++] = PARAM_INT8; | |
| 2921 data[datacounter++] = 30; // coud be 3 meter instead | |
| 2922 data[datacounter++] = settingsGetPointerStandard()->safetystopDepth * 10; | |
| 2923 data[datacounter++] = 60; // could be 6 meter instead | |
| 2924 break; | |
| 2925 | |
| 2926 case 0x45: | |
| 2927 case 0x46: | |
| 2928 data[datacounter++] = PARAM_UNKNOWN; | |
| 2929 data[datacounter++] = 0; | |
| 2930 data[datacounter++] = 0; // SafetyStop End Depth and SafetyStop Reset Depth | |
| 2931 data[datacounter++] = 0; | |
| 2932 break; | |
| 2933 | |
| 2934 case 0x47: | |
| 2935 data[datacounter++] = PARAM_INT15; | |
| 2936 data[datacounter++] = 0; | |
| 2937 data[datacounter++] = 0; | |
| 2938 data[datacounter++] = settingsGetPointerStandard()->logbookOffset & 0xFF; | |
| 2939 data[datacounter++] = settingsGetPointerStandard()->logbookOffset / 0xFF; | |
| 2940 data[datacounter++] = 9000 & 0xFF; | |
| 2941 data[datacounter++] = 9000 / 0xFF; | |
| 2942 break; | |
| 2943 | |
| 2944 case 0x70: | |
| 2945 data[datacounter++] = PARAM_BOOL; | |
| 2946 data[datacounter++] = 0; | |
| 2947 data[datacounter++] = settingsGetPointerStandard()->showDebugInfo; | |
| 2948 data[datacounter++] = 1; | |
| 2949 break; | |
| 2950 | |
| 2951 case 0x71: | |
| 2952 data[datacounter++] = PARAM_ENUM; | |
| 2953 data[datacounter++] = 0; | |
| 2954 data[datacounter++] = settingsGetPointerStandard()->extraDisplay; | |
| 2955 data[datacounter++] = (EXTRADISPLAY_END - 1); | |
| 2956 break; | |
| 2957 | |
| 2958 case 0x72: | |
| 2959 data[datacounter++] = PARAM_ENUM; | |
| 2960 data[datacounter++] = 0; | |
| 2961 data[datacounter++] = settingsGetPointerStandard()->tX_customViewPrimary; | |
| 2962 data[datacounter++] = 8; | |
| 2963 break; | |
| 2964 | |
| 2965 case 0x73: | |
| 2966 data[datacounter++] = PARAM_INT8; | |
| 2967 data[datacounter++] = 0; | |
| 2968 data[datacounter++] = settingsGetPointerStandard()->tX_customViewTimeout; | |
| 2969 data[datacounter++] = 60; | |
| 2970 break; | |
| 2971 | |
| 2972 case 0x74: | |
| 2973 data[datacounter++] = PARAM_ENUM; | |
| 2974 data[datacounter++] = 1; | |
| 2975 data[datacounter++] = settingsGetPointerStandard()->tX_userselectedLeftLowerCornerPrimary; | |
| 2976 data[datacounter++] = 7; | |
| 2977 break; | |
| 2978 | |
| 2979 case 0x75: | |
| 2980 data[datacounter++] = PARAM_INT8; | |
| 2981 data[datacounter++] = 0; | |
| 2982 data[datacounter++] = settingsGetPointerStandard()->tX_userselectedLeftLowerCornerTimeout; | |
| 2983 data[datacounter++] = 60; | |
| 2984 break; | |
| 2985 } | |
| 2986 | |
| 2987 if(datacounter == 0) | |
| 2988 { | |
| 2989 data[datacounter++] = PARAM_UNKNOWN; | |
| 2990 data[datacounter++] = 0; | |
| 2991 data[datacounter++] = 0; // SafetyStop End Depth and SafetyStop Reset Depth | |
| 2992 data[datacounter++] = 0; | |
| 2993 } | |
| 2994 | |
| 2995 return datacounter; | |
| 2996 } | |
| 2997 | |
| 2998 | |
| 2999 uint8_t readData(uint8_t what, uint8_t * data) | |
| 3000 { | |
| 3001 data[0] = 0; | |
| 3002 data[1] = 0; | |
| 3003 data[2] = 0; | |
| 3004 data[3] = 0; | |
| 3005 switch(what) | |
| 3006 { | |
| 3007 case 0x10: | |
| 3008 return getGas(1,data); | |
| 3009 case 0x11: | |
| 3010 return getGas(2,data); | |
| 3011 case 0x12: | |
| 3012 return getGas(3,data); | |
| 3013 case 0x13: | |
| 3014 return getGas(4,data); | |
| 3015 case 0x14: | |
| 3016 return getGas(5,data); | |
| 3017 case 0x15: | |
| 3018 return getDiluent(1,data); | |
| 3019 case 0x16: | |
| 3020 return getDiluent(2,data); | |
| 3021 case 0x17: | |
| 3022 return getDiluent(3,data); | |
| 3023 case 0x18: | |
| 3024 return getDiluent(4,data); | |
| 3025 case 0x19: | |
| 3026 return getDiluent(5,data); | |
| 3027 case 0x1A: | |
| 3028 return getSetpoint(1,data); | |
| 3029 case 0x1B: | |
| 3030 return getSetpoint(2,data); | |
| 3031 case 0x1C: | |
| 3032 return getSetpoint(3,data); | |
| 3033 case 0x1D: | |
| 3034 return getSetpoint(4,data); | |
| 3035 case 0x1E: | |
| 3036 return getSetpoint(5,data); | |
| 3037 case 0x1F: | |
| 3038 data[0] = Settings.CCR_Mode; | |
| 3039 break; | |
| 3040 case 0x20: | |
| 3041 data[0] = Settings.dive_mode; | |
| 3042 break; | |
| 3043 case 0x21: | |
| 3044 data[0] = Settings.deco_type.ub.standard; | |
| 3045 break; | |
| 3046 case 0x22: | |
| 3047 data[0] = Settings.ppO2_max_std; | |
| 3048 break; | |
| 3049 case 0x23: | |
| 3050 data[0] = Settings.ppO2_min; | |
| 3051 break; | |
| 3052 case 0x24: | |
| 3053 data[0] = Settings.future_TTS; | |
| 3054 break; | |
| 3055 case 0x25: | |
| 3056 data[0] = Settings.GF_low; | |
| 3057 break; | |
| 3058 case 0x26: | |
| 3059 data[0] = Settings.GF_high; | |
| 3060 break; | |
| 3061 case 0x27: | |
| 3062 data[0] = Settings.aGF_low; | |
| 3063 break; | |
| 3064 case 0x28: | |
| 3065 data[0] = Settings.aGF_high; | |
| 3066 break; | |
| 3067 case 0x29: | |
| 3068 data[0] = Settings.VPM_conservatism.ub.standard; | |
| 3069 break; | |
| 3070 case 0x2A: | |
| 3071 case 0x2B: | |
| 3072 data[0] = 100; | |
| 3073 break; | |
| 3074 case 0x2C: | |
| 3075 data[0] = Settings.last_stop_depth_meter; | |
| 3076 break; | |
| 3077 case 0x2D: | |
| 3078 data[0] = Settings.brightness; | |
| 3079 break; | |
| 3080 case 0x2E: | |
| 3081 data[0] = Settings.nonMetricalSystem; | |
| 3082 break; | |
| 3083 case 0x2F: | |
| 3084 data[0] = 0; // 0 == 2 sec sampling rate | |
| 3085 break; | |
| 3086 case 0x30: | |
| 3087 data[0] = Settings.salinity; | |
| 3088 break; | |
| 3089 case 0x31: | |
| 3090 data[0] = Settings.tX_colorscheme; | |
| 3091 break; | |
| 3092 case 0x32: | |
| 3093 data[0] = Settings.selected_language; | |
| 3094 break; | |
| 3095 case 0x33: | |
| 3096 data[0] = Settings.date_format; | |
| 3097 break; | |
| 3098 case 0x34: | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
3099 data[0] = (uint8_t)Settings.compassDeclinationDeg; |
| 38 | 3100 break; |
| 3101 case 0x35: | |
| 3102 data[0] = Settings.offsetPressure_mbar; | |
| 3103 break; | |
| 3104 case 0x36: | |
| 3105 if(Settings.safetystopDepth) | |
| 3106 data[0] = 1; | |
| 3107 else | |
| 3108 data[0] = 0; | |
| 3109 break; | |
| 3110 case 0x37: | |
| 3111 data[0] = 0; // calibration gas %O2 -> 0 no gas :-) | |
| 3112 break; | |
| 3113 case 0x38: | |
| 3114 data[0] = Settings.fallbackToFixedSetpoint; | |
| 3115 break; | |
| 3116 case 0x39: | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
3117 data[0] = Settings.FlipDisplay; |
| 38 | 3118 break; |
| 3119 case 0x3A: | |
| 3120 data[0] = Settings.ButtonResponsiveness[3]; | |
| 3121 break; | |
| 3122 case 0x3B: | |
| 3123 data[0] = buttonBalanceTranslateArrayOutHex(settingsGetPointer()->buttonBalance); | |
| 3124 break; | |
| 3125 case 0x3C: | |
| 3126 data[0] = Settings.gasConsumption_bottom_l_min; | |
| 3127 break; | |
| 3128 case 0x3D: | |
| 3129 data[0] = Settings.gasConsumption_deco_l_min; | |
| 3130 break; | |
| 3131 case 0x3E: | |
| 3132 data[0] = Settings.gasConsumption_travel_l_min; | |
| 3133 break; | |
| 3134 case 0x3F: | |
| 3135 data[0] = 0; // fixed ascend rate 10 m/min | |
| 3136 break; | |
| 3137 case 0x40: | |
| 3138 data[0] = 1; // graphical speed indicator | |
| 3139 break; | |
| 3140 case 0x41: | |
| 3141 data[0] = Settings.alwaysShowPPO2; | |
| 3142 break; | |
| 3143 case 0x42: | |
| 3144 data[0] = Settings.offsetTemperature_centigrad; | |
| 3145 break; | |
| 3146 case 0x43: | |
| 3147 if(Settings.safetystopDuration > 4) | |
| 3148 data[0] = 255; // seconds | |
| 3149 else | |
| 3150 data[0] = 60 * Settings.safetystopDuration; | |
| 3151 break; | |
| 3152 case 0x44: | |
| 3153 data[0] = Settings.safetystopDepth * 10; // cbar instead of meter | |
| 3154 break; | |
| 3155 case 0x45: | |
| 3156 if(Settings.safetystopDepth == 3) | |
| 3157 data[0] = 20; // cbar | |
| 3158 else | |
| 3159 data[0] = 30; // cbar | |
| 3160 break; | |
| 3161 case 0x46: | |
| 3162 data[0] = 10; // reset at 10 meter as far as I understood | |
| 3163 break; | |
| 3164 case 0x47: | |
| 3165 data[0] = Settings.logbookOffset & 0xFF; | |
| 3166 data[1] = Settings.logbookOffset / 0xFF; | |
| 3167 break; | |
| 3168 case 0x70: | |
| 3169 data[0] = Settings.showDebugInfo; | |
| 3170 break; | |
| 3171 case 0x71: | |
| 3172 data[0] = Settings.extraDisplay; | |
| 3173 break; | |
| 3174 case 0x72: | |
| 3175 data[0] = Settings.tX_customViewPrimary; | |
| 3176 break; | |
| 3177 case 0x73: | |
| 3178 data[0] = Settings.tX_customViewTimeout; | |
| 3179 break; | |
| 3180 case 0x74: | |
| 3181 data[0] = Settings.tX_userselectedLeftLowerCornerPrimary; | |
| 3182 break; | |
| 3183 case 0x75: | |
| 3184 data[0] = Settings.tX_userselectedLeftLowerCornerTimeout; | |
| 3185 break; | |
| 3186 } | |
| 3187 return 0x4D; | |
| 3188 } | |
| 3189 | |
| 3190 | |
| 3191 uint8_t RTEminimum_required_high(void) | |
| 3192 { | |
| 3193 return RTErequiredHigh; | |
| 3194 } | |
| 3195 uint8_t RTEminimum_required_low(void) | |
| 3196 { | |
| 3197 return RTErequiredLow; | |
| 3198 } | |
| 3199 | |
| 3200 uint8_t FONTminimum_required_high(void) | |
| 3201 { | |
| 3202 return FONTrequiredHigh; | |
| 3203 } | |
| 3204 uint8_t FONTminimum_required_low(void) | |
| 3205 { | |
| 3206 return FONTrequiredLow; | |
| 3207 } | |
| 3208 | |
| 3209 | |
| 3210 void setActualRTEversion(uint8_t high, uint8_t low) | |
| 3211 { | |
| 3212 RTEactualHigh = high; | |
| 3213 RTEactualLow = low; | |
| 3214 } | |
| 3215 | |
| 870 | 3216 #ifndef BOOTLOADER_STANDALONE |
| 38 | 3217 void getActualRTEandFONTversion(uint8_t *RTEhigh, uint8_t *RTElow, uint8_t *FONThigh, uint8_t *FONTlow) |
| 3218 { | |
| 3219 if(RTEhigh && RTElow) | |
| 3220 { | |
| 3221 *RTEhigh = RTEactualHigh; | |
| 3222 *RTElow = RTEactualLow; | |
| 3223 } | |
| 3224 if(FONThigh && FONTlow) | |
| 3225 { | |
| 3226 *FONThigh = *(uint8_t *)0x08132000; | |
| 3227 *FONTlow = *(uint8_t *)0x08132001; | |
| 3228 } | |
| 3229 } | |
| 3230 | |
| 3231 | |
| 3232 uint8_t getLicence(void) | |
| 3233 { | |
| 3234 return hardwareDataGetPointer()->primaryLicence; | |
| 3235 } | |
| 870 | 3236 #endif |
| 38 | 3237 |
| 3238 void firmwareGetDate(RTC_DateTypeDef *SdateOutput) | |
| 3239 { | |
| 3240 SdateOutput->Year = firmwareDataGetPointer()->release_year; | |
| 3241 SdateOutput->Month = firmwareDataGetPointer()->release_month; | |
| 3242 SdateOutput->Date = firmwareDataGetPointer()->release_day; | |
| 3243 } | |
| 3244 | |
| 3245 | |
| 3246 // this should use device specific values stored in OTPROG ROM soon | |
| 3247 void getButtonFactorDefaults(uint8_t* basePercentage, uint8_t* buttonBalanceArray) | |
| 3248 { | |
| 3249 *basePercentage = settingsGetPointerStandard()->ButtonResponsiveness[3]; | |
| 3250 | |
| 3251 for(int i=0;i<3;i++) | |
| 3252 { | |
| 3253 buttonBalanceArray[i] = settingsGetPointerStandard()->buttonBalance[i]; | |
| 3254 } | |
| 3255 } | |
| 3256 | |
| 3257 | |
| 3258 uint8_t buttonBalanceTranslatorHexToArray(uint8_t hexValue, uint8_t* outputArray) | |
| 3259 { | |
| 3260 if(hexValue > 127) | |
| 3261 return 0; | |
| 3262 // internal order: 0 = right, 1 = center, 2 = left | |
| 3263 // external order: Factory,left,center,right | |
| 3264 outputArray[0] = 2 + (hexValue & 0x03); | |
| 3265 hexValue /= 4; | |
| 3266 outputArray[1] = 2 + (hexValue & 0x03); | |
| 3267 hexValue /= 4; | |
| 3268 outputArray[2] = 2 + (hexValue & 0x03); | |
| 3269 | |
| 3270 return 1; | |
| 3271 } | |
| 3272 | |
| 3273 | |
| 3274 uint8_t buttonBalanceTranslateArrayOutHex(const uint8_t* inputArray) | |
| 3275 { | |
| 3276 uint8_t hexValue = 0; | |
| 3277 | |
| 3278 if(inputArray[2] > 2) | |
| 3279 { | |
| 3280 hexValue += inputArray[2] - 2; | |
| 3281 } | |
| 3282 hexValue *= 4; | |
| 3283 | |
| 3284 if(inputArray[1] > 2) | |
| 3285 { | |
| 3286 hexValue += inputArray[1] - 2; | |
| 3287 } | |
| 3288 hexValue *= 4; | |
| 3289 if(inputArray[0] > 2) | |
| 3290 { | |
| 3291 hexValue += inputArray[0] - 2; | |
| 3292 } | |
| 3293 return hexValue; | |
| 3294 } | |
| 3295 | |
| 3296 void settingsWriteFactoryDefaults(uint8_t inputValueRaw, uint8_t *inputBalanceArray) | |
| 3297 { | |
| 3298 if((inputValueRaw >= 70) && (inputValueRaw <= 110)) | |
| 3299 { | |
| 3300 Settings.FactoryButtonBase = inputValueRaw; | |
| 3301 } | |
| 3302 for(int i=0;i<3;i++) | |
| 3303 { | |
| 3304 if((inputBalanceArray[i] >= 2) && (inputBalanceArray[i] <= 5)) | |
| 3305 { | |
| 3306 Settings.FactoryButtonBalance[i] = inputBalanceArray[i]; | |
| 3307 } | |
| 3308 } | |
| 3309 } | |
| 3310 | |
| 3311 | |
| 3312 /** | |
| 3313 ****************************************************************************** | |
| 3314 * @brief settingsHelperButtonSens. / make 32 bit input to three buttons + storage value in [3] | |
| 3315 * @author heinrichs weikamp gmbh | |
| 3316 * @version V 01 | |
| 3317 * @date 19-Sept-2016 | |
| 3318 ****************************************************************************** | |
| 3319 * | |
| 3320 * @param inputValueRaw: | |
| 3321 * @param outArray4Values: [0] is right, [1] is center, [2] is left, [3] is original value with zero balance | |
| 3322 * @retval None | |
| 3323 */ | |
| 3324 void settingsHelperButtonSens_keepPercentageValues(uint32_t inputValueRaw, uint8_t *outArray4Values) | |
| 3325 { | |
| 3326 uint32_t newSensitivity; | |
| 3327 | |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
3328 if(inputValueRaw > MAX_BUTTONRESPONSIVENESS) |
| 38 | 3329 { |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
3330 inputValueRaw = MAX_BUTTONRESPONSIVENESS; |
| 38 | 3331 } |
| 3332 else | |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
3333 if(inputValueRaw < MIN_BUTTONRESPONSIVENESS) |
| 38 | 3334 { |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
3335 inputValueRaw = MIN_BUTTONRESPONSIVENESS; |
| 38 | 3336 } |
| 3337 | |
| 3338 // the unbalanced value | |
| 3339 outArray4Values[3] = inputValueRaw; | |
| 3340 | |
| 3341 // the balanced values | |
| 3342 for(int i=0;i<3;i++) | |
| 3343 { | |
| 3344 newSensitivity = inputValueRaw; | |
| 3345 switch(settingsGetPointer()->buttonBalance[i]) | |
| 3346 { | |
| 3347 case 1: // should not be an option hw 170508 | |
| 3348 newSensitivity -= 20; | |
| 3349 break; | |
| 3350 case 2: | |
| 3351 newSensitivity -= 10; | |
| 3352 break; | |
| 3353 default: | |
| 3354 break; | |
| 3355 case 4: | |
| 3356 newSensitivity += 10; | |
| 3357 break; | |
| 3358 case 5: | |
| 3359 newSensitivity += 20; | |
| 3360 break; | |
| 3361 } | |
| 3362 | |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
3363 if(newSensitivity > MAX_BUTTONRESPONSIVENESS) |
| 38 | 3364 { |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
3365 newSensitivity = MAX_BUTTONRESPONSIVENESS; |
| 38 | 3366 } |
| 3367 outArray4Values[i] = newSensitivity; | |
| 3368 } | |
| 3369 } | |
| 3370 | |
| 3371 | |
| 3372 /** | |
| 3373 ****************************************************************************** | |
| 3374 * @brief settingsHelperButtonSens_translate_to_hwOS_values. / make 32 bit input to three buttons + storage value in [3] | |
| 3375 * @author heinrichs weikamp gmbh | |
| 3376 * @version V 01 | |
| 3377 * @date 19-Sept-2016 | |
| 3378 ****************************************************************************** | |
| 3379 * | |
| 3380 * @param inputValueRaw: | |
| 3381 * @param outArray4Values: [0] is right, [1] is center, [2] is left, [3] is original value with zero balance | |
| 3382 * @retval None | |
| 3383 */ | |
| 3384 void settingsHelperButtonSens_original_translate_to_hwOS_values(const uint32_t inputValueRaw, uint8_t *outArray4Values) | |
| 3385 { | |
| 3386 uint32_t newSensitivity; | |
| 3387 | |
| 3388 for(int i=0;i<3;i++) | |
| 3389 { | |
| 3390 newSensitivity = inputValueRaw; | |
| 3391 switch(settingsGetPointer()->buttonBalance[i]) | |
| 3392 { | |
| 3393 case 1: | |
| 3394 newSensitivity -= 20; | |
| 3395 break; | |
| 3396 case 2: | |
| 3397 newSensitivity -= 10; | |
| 3398 break; | |
| 3399 default: | |
| 3400 break; | |
| 3401 case 4: | |
| 3402 newSensitivity += 10; | |
| 3403 break; | |
| 3404 case 5: | |
| 3405 newSensitivity += 20; | |
| 3406 break; | |
| 3407 } | |
| 3408 | |
| 3409 if(newSensitivity > 100) | |
| 3410 { | |
| 3411 if(newSensitivity <= 105) | |
| 3412 newSensitivity = 10; | |
| 3413 else | |
| 3414 newSensitivity = 7; | |
| 3415 } | |
| 3416 else | |
| 3417 { | |
| 3418 newSensitivity *= 24; | |
| 3419 newSensitivity = 2400 - newSensitivity; | |
| 3420 newSensitivity /= 10; | |
| 3421 | |
| 3422 newSensitivity += 15; | |
| 3423 if(newSensitivity > 255) | |
| 3424 newSensitivity = 255; | |
| 3425 } | |
| 3426 outArray4Values[i] = newSensitivity; | |
| 3427 } | |
| 3428 | |
| 3429 // the unbalanced value | |
| 3430 newSensitivity = inputValueRaw; | |
| 3431 if(newSensitivity > 100) | |
| 3432 { | |
| 3433 if(newSensitivity <= 105) | |
| 3434 newSensitivity = 10; | |
| 3435 else | |
| 3436 newSensitivity = 7; | |
| 3437 } | |
| 3438 else | |
| 3439 { | |
| 3440 newSensitivity *= 24; | |
| 3441 newSensitivity = 2400 - newSensitivity; | |
| 3442 newSensitivity /= 10; | |
| 3443 | |
| 3444 newSensitivity += 15; | |
| 3445 if(newSensitivity > 255) | |
| 3446 newSensitivity = 255; | |
| 3447 } | |
| 3448 outArray4Values[3] = newSensitivity; | |
| 3449 } | |
| 3450 | |
| 3451 | |
| 3452 /** | |
| 3453 ****************************************************************************** | |
| 3454 * @brief settingsHelperButtonSens_translate_percentage_to_hwOS_values. | |
| 3455 * @author heinrichs weikamp gmbh | |
| 3456 * @version V 01 | |
| 3457 * @date 6-March-2017 | |
| 3458 ****************************************************************************** | |
| 3459 * | |
| 3460 * @param inputValuePercentage with buttonBalance included | |
| 3461 * @retval PIC compatible value | |
| 3462 */ | |
| 3463 uint8_t settingsHelperButtonSens_translate_percentage_to_hwOS_values(uint8_t inputValuePercentage) | |
| 3464 { | |
| 3465 uint32_t newSensitivity = inputValuePercentage; | |
| 3466 | |
| 3467 if(newSensitivity > 100) | |
| 3468 { | |
| 3469 if(newSensitivity <= 105) | |
| 3470 newSensitivity = 10; | |
| 3471 else | |
| 3472 newSensitivity = 7; | |
| 3473 } | |
| 3474 else | |
| 3475 { | |
| 3476 newSensitivity *= 24; | |
| 3477 newSensitivity = 2400 - newSensitivity; | |
| 3478 newSensitivity /= 10; | |
| 3479 | |
| 3480 newSensitivity += 15; | |
| 3481 if(newSensitivity > 255) | |
| 3482 newSensitivity = 255; | |
| 3483 } | |
| 3484 return (uint8_t)newSensitivity; | |
| 3485 } | |
| 3486 | |
| 3487 | |
| 3488 /** | |
| 3489 ****************************************************************************** | |
| 3490 * @brief settingsHelperButtonSens_translate_hwOS_values_to_percentage. | |
| 3491 * @author heinrichs weikamp gmbh | |
| 3492 * @version V 01 | |
| 3493 * @date 6-March-2017 | |
| 3494 ****************************************************************************** | |
| 3495 * | |
| 3496 * @param PIC compatible value | |
| 3497 * @retval Percentage | |
| 3498 */ | |
| 3499 uint8_t settingsHelperButtonSens_translate_hwOS_values_to_percentage(uint8_t inputValuePIC) | |
| 3500 { | |
| 3501 if(inputValuePIC >= 15) | |
| 3502 { | |
| 3503 return(uint8_t)((25500 - (inputValuePIC)*100) / 240); | |
| 3504 } | |
| 3505 else | |
| 3506 { | |
| 3507 if(inputValuePIC >= 10) | |
| 3508 { | |
| 3509 return 105; | |
| 3510 } | |
| 3511 else | |
| 3512 { | |
| 3513 return 110; | |
| 3514 } | |
| 3515 } | |
| 3516 } | |
| 662 | 3517 |
| 3518 void reset_SettingWarning() | |
| 3519 { | |
| 3520 settingsWarning = 0; | |
| 3521 } | |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3522 |
| 662 | 3523 inline uint8_t isSettingsWarning() |
| 3524 { | |
| 3525 return settingsWarning; | |
| 3526 } | |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3527 |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3528 bool isScrubberError(const SScrubberData *scrubberData) |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3529 { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3530 if (scrubberData->TimerCur <= SCRUBBER_ERROR_TIME) { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3531 return true; |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3532 } |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3533 |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3534 return false; |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3535 } |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3536 |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3537 bool isScrubberWarning(const SScrubberData *scrubberData) |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3538 { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3539 if (scrubberData->TimerCur <= SCRUBBER_WARNING_TIME) { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3540 return true; |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3541 } |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3542 |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3543 return false; |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
1011
diff
changeset
|
3544 } |
| 1027 | 3545 |
