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