Mercurial > public > ostc4
annotate Discovery/Src/settings.c @ 1050:88b6ab90c55a GasConsumption
Added separate LLC view for surface GF:
A new LLC view has been added. In addition the surface GF is now clipped to a value of 9.99 => 999% in the visualization
| author | Ideenmodellierer |
|---|---|
| date | Wed, 19 Nov 2025 21:34:18 +0100 |
| parents | 6fb16ca39125 |
| 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, |
| 1047 | 71 .versionThird = 4, |
| 968 | 72 .versionBeta = 0, |
| 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, |
|
1019
67e3dbc4d212
make sure version number is increased after releases
heinrichsweikamp
parents:
1017
diff
changeset
|
78 .release_month = 6, |
|
67e3dbc4d212
make sure version number is increased after releases
heinrichsweikamp
parents:
1017
diff
changeset
|
79 .release_day = 9, |
| 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 | |
| 2011 | |
| 2012 uint8_t firmwareVersion_16bit_high(void) | |
| 2013 { | |
|
319
d8e86af78474
bugfix: correct packed main version number in dive header
Jan Mulder <jlmulder@xs4all.nl>
parents:
286
diff
changeset
|
2014 return ((firmware_FirmwareData.versionFirst & 0x1F) << 3) + ((firmware_FirmwareData.versionSecond & 0x1C) >> 2); |
| 38 | 2015 } |
| 2016 | |
| 2017 uint8_t firmwareVersion_16bit_low(void) | |
| 2018 { | |
| 2019 return ((firmware_FirmwareData.versionSecond & 0x03) << 6) + ((firmware_FirmwareData.versionThird & 0x1F) << 1) + (firmware_FirmwareData.versionBeta & 0x01); | |
| 2020 } | |
| 2021 | |
|
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
|
2022 inline SSettings* settingsGetPointer(void) |
| 38 | 2023 { |
| 2024 return &Settings; | |
| 2025 } | |
| 1027 | 2026 SSettings* profileGetPointer(uint8_t number) |
| 2027 { | |
| 2028 SSettings* returnPointer = NULL; | |
| 38 | 2029 |
| 1027 | 2030 if(number < NUMBER_OF_PROFILES) |
| 2031 { | |
| 2032 returnPointer = &Profile[number]; | |
| 2033 } | |
| 2034 | |
| 2035 return returnPointer; | |
| 2036 } | |
| 38 | 2037 |
| 2038 // =============================================================================== | |
| 2039 // set_settings_to_Standard | |
| 2040 /// @brief This function overwrites the current settings of the system | |
| 2041 /// with the EXCEPTION of the personalDiveCount | |
| 2042 /// | |
| 2043 /// It additionally calls set_new_settings_missing_in_ext_flash() and | |
| 2044 /// check_and_correct_settings(), even so this shouldn't be necessary. | |
| 2045 /// It is called on every start and from Reset All. | |
| 2046 /// | |
| 2047 /// 160622 added lastDiveLogIdBackup | |
| 2048 /// | |
| 2049 // =============================================================================== | |
| 1027 | 2050 void set_settings_to_Standard(uint8_t whichSettings) |
| 38 | 2051 { |
| 2052 SSettings *pSettings; | |
| 2053 const SSettings *pSettingsStandard; | |
| 2054 uint16_t personalDiveCountBackup; | |
| 2055 uint8_t lastDiveLogIdBackup; | |
| 997 | 2056 uint32_t sampleStartBackup; |
| 38 | 2057 pSettings = settingsGetPointer(); |
| 2058 pSettingsStandard = settingsGetPointerStandard(); | |
| 1027 | 2059 uint8_t profileBackup = pSettings->activeProfile; |
| 2060 | |
| 2061 switch(whichSettings) | |
| 2062 { | |
| 2063 default: | |
| 2064 case EF_SETTINGS: | |
| 2065 break; | |
| 2066 case EF_PROFILE0: pSettings = profileGetPointer(0); | |
| 2067 break; | |
| 2068 case EF_PROFILE1: pSettings = profileGetPointer(1); | |
| 2069 break; | |
| 2070 case EF_PROFILE2: pSettings = profileGetPointer(2); | |
| 2071 break; | |
| 2072 case EF_PROFILE3: pSettings = profileGetPointer(3); | |
| 2073 break; | |
| 2074 } | |
| 38 | 2075 |
| 2076 personalDiveCountBackup = pSettings->personalDiveCount; | |
| 2077 lastDiveLogIdBackup = pSettings->lastDiveLogId; | |
| 997 | 2078 sampleStartBackup = pSettings->logFlashNextSampleStartAddress; |
| 2079 | |
| 38 | 2080 memcpy(pSettings,pSettingsStandard,sizeof(*pSettings)); |
| 2081 pSettings->personalDiveCount = personalDiveCountBackup; | |
| 2082 pSettings->lastDiveLogId = lastDiveLogIdBackup; | |
| 997 | 2083 pSettings->logFlashNextSampleStartAddress = sampleStartBackup; |
| 38 | 2084 |
| 2085 pSettings->firmwareVersion[0] = firmware_FirmwareData.versionFirst; | |
| 2086 pSettings->firmwareVersion[1] = firmware_FirmwareData.versionSecond; | |
| 2087 pSettings->firmwareVersion[2] = firmware_FirmwareData.versionThird; | |
| 2088 pSettings->firmwareVersion[3] = firmware_FirmwareData.versionBeta; | |
| 2089 | |
| 997 | 2090 memset(pSettings->customtext,0,60); |
| 2091 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
|
2092 pSettings->cv_configuration &= ~(1 << CVIEW_sensors | 1 << CVIEW_sensors_mV | 1 << CVIEW_Timer); |
| 997 | 2093 |
| 1027 | 2094 switch(whichSettings) /* some default data may be dependend on the default value => adapt setting */ |
| 2095 { | |
| 2096 default: | |
| 2097 case EF_SETTINGS: pSettings->activeProfile = profileBackup; | |
| 2098 break; | |
| 2099 case EF_PROFILE0: pSettings = profileGetPointer(0); | |
| 2100 break; | |
| 2101 case EF_PROFILE1: pSettings = profileGetPointer(1); | |
| 2102 break; | |
| 2103 case EF_PROFILE2: pSettings = profileGetPointer(2); /* MCCR */ | |
| 2104 pSettings->dive_mode = DIVEMODE_CCR; | |
| 2105 break; | |
| 2106 case EF_PROFILE3: pSettings = profileGetPointer(3); /* ECCR */ | |
| 2107 pSettings->dive_mode = DIVEMODE_CCR; | |
| 2108 pSettings->CCR_Mode = CCRMODE_Sensors; | |
| 2109 break; | |
| 2110 } | |
| 2111 | |
| 2112 set_new_settings_missing_in_ext_flash(whichSettings); | |
| 2113 check_and_correct_settings(whichSettings); | |
| 38 | 2114 // has to be called too: createDiveSettings(); |
| 2115 } | |
| 2116 | |
| 2117 | |
| 2118 // =============================================================================== | |
| 2119 // mod_settings_for_first_start_with_empty_ext_flash | |
| 2120 /// @brief This function overwrites some settings of the system | |
| 2121 /// It is called on every start. | |
| 2122 /// Those settings will be overwriten by ext_flash_read_settings() | |
| 2123 /// Will be kept if ext_flash_read_settings() is invalid because | |
| 2124 /// it is still empty. | |
| 2125 /// | |
| 2126 // =============================================================================== | |
| 2127 void mod_settings_for_first_start_with_empty_ext_flash(void) | |
| 2128 { | |
| 2129 settingsGetPointer()->debugModeOnStart = 1; // | |
| 2130 } | |
| 2131 | |
| 2132 | |
| 2133 | |
| 2134 // =============================================================================== | |
| 2135 // hwOS4_to_hwOS_GasType | |
| 2136 /// @brief Helper for get gas / diluent | |
| 2137 /// | |
| 2138 // =============================================================================== | |
| 2139 uint8_t hwOS4_to_hwOS_GasType(uint8_t inOSTC4style) | |
| 2140 { | |
| 2141 switch(inOSTC4style) | |
| 2142 { | |
| 2143 case (1+2): // first | |
| 2144 case (2): // first | |
| 2145 return 1; // hwOS style first | |
| 2146 case (1+4): // deco | |
| 2147 case (4): // deco | |
| 2148 return 3; // hwOS style deco | |
| 2149 case (1+8): // travel | |
| 2150 case (8): // travel | |
| 2151 return 2; // hwOS style travel | |
| 2152 default: | |
| 2153 return 0; // hwOS style Disabled | |
| 2154 } | |
| 2155 } | |
| 2156 | |
| 2157 | |
| 2158 // =============================================================================== | |
| 2159 // hwOS_to_hwOS4_GasType | |
| 2160 /// @brief Helper for set gas / diluent | |
| 2161 /// | |
| 2162 // =============================================================================== | |
| 2163 uint8_t hwOS_to_hwOS4_GasType(uint8_t inOSTC4style) | |
| 2164 { | |
| 2165 switch(inOSTC4style) | |
| 2166 { | |
| 2167 case (1): // first | |
| 2168 return 1+2; // hwOS4 style first | |
| 2169 case (2): // travel (normal for diluent) | |
| 2170 return 1+8; // hwOS4 style travel | |
| 2171 case (3): // deco | |
| 2172 return 1+4; // hwOS4 style deco | |
| 2173 default: | |
| 2174 return 0; // hwOS4 style inactive | |
| 2175 } | |
| 2176 } | |
| 2177 | |
| 2178 | |
| 2179 | |
| 2180 // =============================================================================== | |
| 2181 // setGas | |
| 2182 /// @brief This function overwrites one gas, including mode and deco depth, | |
| 2183 /// it returns 0x4D prompt which is not used by writeData() that calls it. | |
| 2184 /// | |
| 2185 /// @param i the gas id from 1 to 5 for OC and 6 to 10 for CCR, 0 is the extra gas | |
| 2186 /// @param *data 5 bytes with the first the command to call setGas and the four | |
| 2187 /// following bytes to define oxygen, helium, mode and deco depth | |
| 2188 /// | |
| 2189 /// @return 0x4D (prompt that is not used) | |
| 2190 // =============================================================================== | |
| 2191 uint8_t setGas(int i,uint8_t * data) | |
| 2192 { | |
| 2193 if(!checkValue(data[1],4,100)) | |
| 2194 return ERROR_; | |
| 2195 if(!checkValue(data[4],0,250)) | |
| 2196 return ERROR_; | |
| 2197 | |
| 2198 Settings.gas[i].oxygen_percentage = data[1]; | |
| 2199 Settings.gas[i].helium_percentage = data[2]; | |
| 2200 Settings.gas[i].note.uw = hwOS_to_hwOS4_GasType(data[3]); | |
| 2201 Settings.gas[i].depth_meter = data[4]; | |
| 2202 return 0x4d; | |
| 2203 } | |
| 2204 | |
| 2205 | |
| 2206 uint8_t getGas(int i,uint8_t * data) | |
| 2207 { | |
| 2208 data[0] = Settings.gas[i].oxygen_percentage; | |
| 2209 data[1] = Settings.gas[i].helium_percentage; | |
| 2210 data[2] = hwOS4_to_hwOS_GasType(Settings.gas[i].note.uw); | |
| 2211 data[3] = Settings.gas[i].depth_meter; | |
| 2212 return 0x4d; | |
| 2213 } | |
| 2214 | |
| 2215 uint8_t setDiluent(int i,uint8_t * data) | |
| 2216 { | |
| 2217 if(!checkValue(data[1],4,100)) | |
| 2218 return ERROR_; | |
| 2219 if(!checkValue(data[4],0,250)) | |
| 2220 return ERROR_; | |
| 2221 | |
| 2222 Settings.gas[NUM_OFFSET_DILUENT + i].oxygen_percentage = data[1]; | |
| 2223 Settings.gas[NUM_OFFSET_DILUENT + i].helium_percentage = data[2]; | |
| 2224 Settings.gas[NUM_OFFSET_DILUENT + i].note.uw = hwOS_to_hwOS4_GasType(data[3]); | |
| 2225 Settings.gas[NUM_OFFSET_DILUENT + i].depth_meter = data[4]; | |
| 2226 return 0x4d; | |
| 2227 } | |
| 2228 | |
| 2229 uint8_t getDiluent(int i,uint8_t * data) | |
| 2230 { | |
| 2231 data[0] = Settings.gas[NUM_OFFSET_DILUENT + i].oxygen_percentage; | |
| 2232 data[1] = Settings.gas[NUM_OFFSET_DILUENT + i].helium_percentage; | |
| 2233 data[2] = hwOS4_to_hwOS_GasType(Settings.gas[NUM_OFFSET_DILUENT + i].note.uw); | |
| 2234 data[3] = Settings.gas[NUM_OFFSET_DILUENT + i].depth_meter; | |
| 2235 return 0x4d; | |
| 2236 } | |
| 2237 | |
| 2238 uint8_t setSetpoint(int i,uint8_t * data) | |
| 2239 { | |
| 2240 if(!checkValue(data[1],50,160)) | |
| 2241 return ERROR_; | |
| 2242 if(!checkValue(data[2],0,250)) | |
| 2243 return ERROR_; | |
| 2244 | |
| 2245 Settings.setpoint[i].setpoint_cbar = data[1]; | |
| 2246 Settings.setpoint[i].depth_meter = data[2]; | |
| 2247 return 0x4d; | |
| 2248 } | |
| 2249 | |
| 2250 uint8_t getSetpoint(int i,uint8_t * data) | |
| 2251 { | |
| 2252 data[0] = Settings.setpoint[i].setpoint_cbar; | |
| 2253 data[1] = Settings.setpoint[i].depth_meter; | |
| 2254 return 0x4d; | |
| 2255 } | |
| 2256 | |
| 2257 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to) | |
| 2258 { | |
| 2259 if(value >= from && value <= to) | |
| 2260 return 1; | |
| 2261 return 0; | |
| 2262 } | |
| 2263 | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2264 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
|
2265 { |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2266 if(value >= from && value <= to) |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2267 return true; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2268 return false; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2269 } |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2270 |
| 38 | 2271 uint8_t writeData(uint8_t * data) |
| 2272 { | |
| 2273 uint32_t newSensitivity; | |
| 2274 uint16_t newDuration, newOffset; | |
| 2275 uint8_t newStopDepth; | |
| 2276 | |
| 2277 switch(data[0]) | |
| 2278 { | |
| 2279 case 0x10: | |
| 2280 return setGas(1,data); | |
| 2281 case 0x11: | |
| 2282 return setGas(2,data); | |
| 2283 case 0x12: | |
| 2284 return setGas(3,data); | |
| 2285 case 0x13: | |
| 2286 return setGas(4,data); | |
| 2287 case 0x14: | |
| 2288 return setGas(5,data); | |
| 2289 case 0x15: | |
| 2290 return setDiluent(1,data); | |
| 2291 case 0x16: | |
| 2292 return setDiluent(2,data); | |
| 2293 case 0x17: | |
| 2294 return setDiluent(3,data); | |
| 2295 case 0x18: | |
| 2296 return setDiluent(4,data); | |
| 2297 case 0x19: | |
| 2298 return setDiluent(5,data); | |
| 2299 case 0x1A: | |
| 2300 return setSetpoint(1,data); | |
| 2301 case 0x1B: | |
| 2302 return setSetpoint(2,data); | |
| 2303 case 0x1C: | |
| 2304 return setSetpoint(3,data); | |
| 2305 case 0x1D: | |
| 2306 return setSetpoint(4,data); | |
| 2307 case 0x1E: | |
| 2308 return setSetpoint(5,data); | |
| 2309 case 0x1F: | |
| 2310 if(!checkValue(data[2],0,1)) | |
| 2311 return ERROR_; | |
| 2312 Settings.CCR_Mode = data[1]; | |
| 2313 break; | |
| 2314 case 0x20: | |
| 2315 if(!checkValue(data[1],0,3)) | |
| 2316 return ERROR_; | |
| 2317 Settings.dive_mode = data[1]; | |
| 2318 break; | |
| 2319 case 0x21: | |
| 2320 if(!checkValue(data[1],1,2)) | |
| 2321 return ERROR_; | |
| 2322 Settings.deco_type.ub.standard = data[1] & 0x0F; | |
| 2323 //Settings.deco_type.ub.alternative = (data[1] & 0xF0) >> 4; | |
| 2324 break; | |
| 2325 case 0x22: | |
| 2326 if(!checkValue(data[1],100,190)) | |
| 2327 return ERROR_; | |
| 2328 Settings.ppO2_max_std = data[1]; | |
| 2329 break; | |
| 2330 case 0x23: | |
| 2331 if(!checkValue(data[1],15,15)) | |
| 2332 return ERROR_; | |
| 2333 Settings.ppO2_min = data[1]; | |
| 2334 break; | |
| 2335 case 0x24: | |
| 2336 if(!checkValue(data[1],0,15)) | |
| 2337 return ERROR_; | |
| 2338 Settings.future_TTS = data[1]; | |
| 2339 break; | |
| 2340 case 0x25: | |
| 2341 if(!checkValue(data[1],10,99)) | |
| 2342 return ERROR_; | |
| 2343 Settings.GF_low = data[1]; | |
| 2344 break; | |
| 2345 case 0x26: | |
| 2346 if(!checkValue(data[1],45,99)) | |
| 2347 return ERROR_; | |
| 2348 Settings.GF_high = data[1]; | |
| 2349 break; | |
| 2350 case 0x27: | |
| 2351 if(!checkValue(data[1],10,99)) | |
| 2352 return ERROR_; | |
| 2353 Settings.aGF_low = data[1]; | |
| 2354 break; | |
| 2355 case 0x28: | |
| 2356 if(!checkValue(data[1],45,99)) | |
| 2357 return ERROR_; | |
| 2358 Settings.aGF_high = data[1]; | |
| 2359 break; | |
| 2360 case 0x29: | |
| 2361 if(!checkValue(data[1],0,5)) | |
| 2362 return ERROR_; | |
| 2363 Settings.VPM_conservatism.ub.standard = data[1]; | |
| 2364 break; | |
| 2365 case 0x2A: | |
| 2366 case 0x2B: | |
| 2367 return ERROR_; | |
| 2368 case 0x2C: | |
| 2369 if(!checkValue(data[1],3,9)) | |
| 2370 return ERROR_; | |
| 2371 Settings.last_stop_depth_meter = data[1]; | |
| 2372 break; | |
| 2373 case 0x2D: | |
| 2374 if(!checkValue(data[1],0,4)) | |
| 2375 return ERROR_; | |
| 2376 Settings.brightness = data[1]; | |
| 2377 break; | |
| 2378 case 0x2E: | |
| 2379 if(!checkValue(data[1],0,1)) | |
| 2380 return ERROR_; | |
| 2381 Settings.nonMetricalSystem = data[1]; | |
| 2382 break; | |
| 2383 case 0x2F: | |
| 2384 return ERROR_; | |
| 2385 case 0x30: | |
| 2386 if(!checkValue(data[1],0,4)) | |
| 2387 return ERROR_; | |
| 2388 Settings.salinity = data[1]; | |
| 2389 break; | |
| 2390 case 0x31: | |
| 2391 if(!checkValue(data[1],0,3)) | |
| 2392 return ERROR_; | |
| 2393 Settings.tX_colorscheme = data[1]; | |
| 2394 GFX_use_colorscheme(Settings.tX_colorscheme); | |
| 2395 break; | |
| 2396 case 0x32: | |
| 2397 if(!checkValue(data[1],0,4)) | |
| 2398 return ERROR_; | |
| 2399 Settings.selected_language = data[1]; | |
| 2400 break; | |
| 2401 case 0x33: | |
| 2402 if(!checkValue(data[1],0,2)) | |
| 2403 return ERROR_; | |
| 2404 Settings.date_format = data[1]; | |
| 2405 break; | |
| 2406 case 0x34: | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2407 if (!checkValueSigned(data[1], -MAX_COMPASS_DECLINATION_DEG, MAX_COMPASS_DECLINATION_DEG)) |
| 38 | 2408 return ERROR_; |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2409 Settings.compassDeclinationDeg = (int8_t)data[1]; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2410 |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2411 break; |
| 38 | 2412 case 0x35: |
| 2413 if(data[1] & 0x80) | |
| 2414 { | |
| 2415 data[1] = ~(data[1]); | |
|
337
38367bb982b8
Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents:
334
diff
changeset
|
2416 if(!checkValue(data[1],0,PRESSURE_OFFSET_LIMIT_MBAR)) |
| 38 | 2417 return ERROR_; |
| 2418 Settings.offsetPressure_mbar = 0 - data[1]; | |
| 2419 } | |
| 2420 else | |
| 2421 { | |
|
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 = data[1]; | |
| 2425 } | |
| 2426 break; | |
| 2427 case 0x36: | |
| 2428 if(!checkValue(data[1],0,1)) | |
| 2429 return ERROR_; | |
| 2430 if(data[1]) | |
| 2431 Settings.safetystopDuration = settingsGetPointerStandard()->safetystopDuration; | |
| 2432 else | |
| 2433 Settings.safetystopDuration = 0; | |
| 2434 break; | |
| 2435 case 0x37: | |
| 2436 return ERROR_; | |
| 2437 case 0x38: | |
| 2438 if(!checkValue(data[1],0,1)) | |
| 2439 return ERROR_; | |
| 2440 Settings.fallbackToFixedSetpoint = data[1]; | |
| 2441 break; | |
| 2442 case 0x39: | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2443 if (!checkValue(data[1], 0, 1)) |
| 38 | 2444 return ERROR_; |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2445 setFlipDisplay(data[1]); |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2446 |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2447 break; |
| 38 | 2448 case 0x3A: |
| 2449 if(!checkValue(data[1],70,110)) | |
| 2450 return ERROR_; | |
| 2451 newSensitivity = data[1]; | |
| 2452 settingsHelperButtonSens_keepPercentageValues(newSensitivity, settingsGetPointer()->ButtonResponsiveness); | |
| 2453 setButtonResponsiveness(Settings.ButtonResponsiveness); | |
| 2454 break; | |
| 2455 case 0x3B: | |
| 2456 // value between 0 and 127 | |
| 2457 if(buttonBalanceTranslatorHexToArray(data[1], settingsGetPointer()->buttonBalance)) | |
| 2458 { | |
| 2459 settingsHelperButtonSens_keepPercentageValues(settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->ButtonResponsiveness); | |
| 2460 } | |
| 2461 else // value >= 128 (bit 7 set) factory reset | |
| 2462 { | |
| 2463 getButtonFactorDefaults(&settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->buttonBalance); | |
| 2464 settingsHelperButtonSens_keepPercentageValues(settingsGetPointerStandard()->ButtonResponsiveness[3], settingsGetPointer()->ButtonResponsiveness); | |
| 2465 } | |
| 2466 // valid for both: | |
| 2467 setButtonResponsiveness(Settings.ButtonResponsiveness); | |
| 2468 break; | |
| 2469 case 0x3C: | |
| 2470 if(!checkValue(data[1],5,50)) | |
| 2471 return ERROR_; | |
| 2472 Settings.gasConsumption_bottom_l_min = data[1]; | |
| 2473 break; | |
| 2474 case 0x3D: | |
| 2475 if(!checkValue(data[1],5,50)) | |
| 2476 return ERROR_; | |
| 2477 Settings.gasConsumption_deco_l_min = data[1]; | |
| 2478 break; | |
| 2479 case 0x3E: | |
| 2480 if(!checkValue(data[1],5,50)) | |
| 2481 return ERROR_; | |
| 2482 Settings.gasConsumption_travel_l_min = data[1]; | |
| 2483 break; | |
| 2484 case 0x3F: | |
| 2485 case 0x40: | |
| 2486 return ERROR_; | |
| 2487 case 0x41: | |
| 2488 if(!checkValue(data[1],0,1)) | |
| 2489 return ERROR_; | |
| 2490 Settings.alwaysShowPPO2 = data[1]; | |
| 2491 break; | |
| 2492 case 0x42: | |
| 2493 if(data[1] & 0x80) | |
| 2494 { | |
| 2495 data[1] = ~(data[1]); | |
| 2496 if(!checkValue(data[1],0,20)) | |
| 2497 return ERROR_; | |
| 2498 Settings.offsetTemperature_centigrad = 0 - data[1]; | |
| 2499 } | |
| 2500 else | |
| 2501 { | |
| 2502 if(!checkValue(data[1],0,20)) | |
| 2503 return ERROR_; | |
| 2504 Settings.offsetTemperature_centigrad = data[1]; | |
| 2505 } | |
| 2506 break; | |
| 2507 case 0x43: | |
| 2508 if(!checkValue(data[1],60,255)) | |
| 2509 return ERROR_; | |
| 2510 newDuration = (uint16_t)data[1] + 59; | |
| 2511 newDuration /= 60; | |
| 2512 Settings.safetystopDuration = (uint8_t)newDuration; | |
| 2513 break; | |
| 2514 case 0x44: | |
| 2515 if(!checkValue(data[1],21,61)) | |
| 2516 return ERROR_; | |
| 2517 newStopDepth = data[1] + 9; | |
| 2518 if(newStopDepth > 60) | |
| 2519 newStopDepth = 60; | |
| 2520 newStopDepth /= 10; | |
| 2521 Settings.safetystopDepth = newStopDepth; | |
| 2522 break; | |
| 2523 case 0x45: | |
| 2524 case 0x46: | |
| 2525 return ERROR_; | |
| 2526 case 0x47: | |
| 2527 newOffset = data[2] * 256; | |
| 2528 newOffset += data[1]; | |
| 2529 if(newOffset > 9000) | |
| 2530 return ERROR_; | |
| 2531 Settings.logbookOffset = newOffset; | |
| 2532 break; | |
| 2533 case 0x70: | |
| 2534 if(!checkValue(data[1],0,1)) | |
| 2535 return ERROR_; | |
| 2536 Settings.showDebugInfo = data[1]; | |
| 2537 break; | |
| 2538 case 0x71: | |
| 2539 if(!checkValue(data[1],0,(EXTRADISPLAY_END - 1))) | |
| 2540 return ERROR_; | |
| 2541 Settings.extraDisplay = data[1]; | |
| 2542 break; | |
| 2543 case 0x72: | |
| 2544 if(!checkValue(data[1],0,8)) | |
| 2545 return ERROR_; | |
| 2546 Settings.tX_customViewPrimary = data[1]; | |
| 2547 break; | |
| 2548 case 0x73: | |
| 2549 if(!checkValue(data[1],0,20)) | |
| 2550 return ERROR_; | |
| 2551 Settings.tX_customViewTimeout = data[1]; | |
| 2552 break; | |
| 2553 case 0x74: | |
| 2554 if(!checkValue(data[1],1,7)) | |
| 2555 return ERROR_; | |
| 2556 Settings.tX_userselectedLeftLowerCornerPrimary = data[1]; | |
| 2557 break; | |
| 2558 case 0x75: | |
| 2559 if(!checkValue(data[1],0,20)) | |
| 2560 return ERROR_; | |
| 2561 Settings.tX_userselectedLeftLowerCornerTimeout = data[1]; | |
| 2562 break; | |
| 2563 } | |
| 2564 return 0; | |
| 2565 } | |
| 2566 | |
| 2567 | |
| 2568 uint8_t readDataLimits__8and16BitValues_4and7BytesOutput(uint8_t what, uint8_t * data) | |
| 2569 { | |
| 2570 enum JeanDoParameterType { | |
| 2571 PARAM_UNKNOWN = 0, | |
| 2572 PARAM_INT15 = 1, | |
| 2573 PARAM_INT8, | |
| 2574 PARAM_DECI, | |
| 2575 PARAM_CENTI, | |
| 2576 PARAM_MILI, | |
| 2577 PARAM_PERCENT, | |
| 2578 PARAM_SEC, | |
| 2579 PARAM_COLOR, | |
| 2580 PARAM_BOOL, | |
| 2581 PARAM_ENUM, | |
| 2582 PARAM_SIGNED = 128, | |
| 2583 PARAM_SDECI = PARAM_SIGNED|PARAM_DECI, | |
| 2584 PARAM_SSEC = PARAM_SIGNED|PARAM_SEC, | |
| 2585 PARAM_SINT = PARAM_SIGNED|PARAM_INT8 | |
| 2586 }; | |
| 2587 | |
| 2588 // uint32_t buttonSensitivity; | |
| 2589 uint16_t newDuration; | |
| 2590 | |
| 2591 uint8_t datacounter = 0; | |
| 2592 | |
| 2593 data[0] = 0; | |
| 2594 data[1] = 0; | |
| 2595 data[2] = 0; | |
| 2596 data[3] = 0; | |
| 2597 datacounter = 0; | |
| 2598 | |
| 2599 switch(what) | |
| 2600 { | |
| 2601 case 0x10: | |
| 2602 case 0x11: | |
| 2603 case 0x12: | |
| 2604 case 0x13: | |
| 2605 case 0x14: | |
| 2606 data[datacounter++] = PARAM_INT8; | |
| 2607 data[datacounter++] = 4; | |
| 2608 data[datacounter++] = settingsGetPointerStandard()->gas[1].oxygen_percentage; | |
| 2609 data[datacounter++] = 100; | |
| 2610 break; | |
| 2611 | |
| 2612 case 0x15: | |
| 2613 case 0x16: | |
| 2614 case 0x17: | |
| 2615 case 0x18: | |
| 2616 case 0x19: | |
| 2617 data[datacounter++] = PARAM_INT8; | |
| 2618 data[datacounter++] = 4; | |
| 2619 data[datacounter++] = settingsGetPointerStandard()->gas[1].oxygen_percentage; | |
| 2620 data[datacounter++] = 100; | |
| 2621 break; | |
| 2622 | |
| 2623 case 0x1A: | |
| 2624 case 0x1B: | |
| 2625 case 0x1C: | |
| 2626 case 0x1D: | |
| 2627 case 0x1E: | |
| 2628 data[datacounter++] = PARAM_CENTI; | |
| 2629 data[datacounter++] = 50; | |
| 2630 data[datacounter++] = settingsGetPointerStandard()->setpoint[1].setpoint_cbar; | |
| 2631 data[datacounter++] = 160; | |
| 2632 break; | |
| 2633 | |
| 2634 case 0x1F: | |
| 2635 data[datacounter++] = PARAM_ENUM; | |
| 2636 data[datacounter++] = 0; | |
| 2637 data[datacounter++] = settingsGetPointerStandard()->CCR_Mode; | |
| 2638 data[datacounter++] = 1; | |
| 2639 break; | |
| 2640 | |
| 2641 case 0x20: | |
| 2642 data[datacounter++] = PARAM_ENUM; | |
| 2643 data[datacounter++] = 0; | |
| 2644 data[datacounter++] = settingsGetPointerStandard()->dive_mode; | |
| 2645 data[datacounter++] = 3; | |
| 2646 break; | |
| 2647 | |
| 2648 case 0x21: | |
| 2649 data[datacounter++] = PARAM_ENUM; | |
| 2650 data[datacounter++] = 1; | |
| 2651 data[datacounter++] = settingsGetPointerStandard()->deco_type.ub.standard; | |
| 2652 data[datacounter++] = 2; | |
| 2653 break; | |
| 2654 | |
| 2655 case 0x22: | |
| 2656 data[datacounter++] = PARAM_CENTI; | |
| 2657 data[datacounter++] = 100; | |
| 2658 data[datacounter++] = settingsGetPointerStandard()->ppO2_max_std; | |
| 2659 data[datacounter++] = 190; | |
| 2660 break; | |
| 2661 | |
| 2662 case 0x23: | |
| 2663 data[datacounter++] = PARAM_CENTI; | |
| 2664 data[datacounter++] = 15; | |
| 2665 data[datacounter++] = settingsGetPointerStandard()->ppO2_min; | |
| 2666 data[datacounter++] = 15; | |
| 2667 break; | |
| 2668 | |
| 2669 case 0x24: | |
| 2670 data[datacounter++] = PARAM_INT8; // minutes | |
| 2671 data[datacounter++] = 0; | |
| 2672 data[datacounter++] = settingsGetPointerStandard()->future_TTS; | |
| 2673 data[datacounter++] = 15; | |
| 2674 break; | |
| 2675 | |
| 2676 case 0x25: | |
| 2677 data[datacounter++] = PARAM_PERCENT; | |
| 2678 data[datacounter++] = 10; | |
| 2679 data[datacounter++] = settingsGetPointerStandard()->GF_low; | |
| 2680 data[datacounter++] = 99; | |
| 2681 break; | |
| 2682 | |
| 2683 case 0x26: | |
| 2684 data[datacounter++] = PARAM_PERCENT; | |
| 2685 data[datacounter++] = 45; | |
| 2686 data[datacounter++] = settingsGetPointerStandard()->GF_high; | |
| 2687 data[datacounter++] = 99; | |
| 2688 break; | |
| 2689 | |
| 2690 case 0x27: | |
| 2691 data[datacounter++] = PARAM_PERCENT; | |
| 2692 data[datacounter++] = 10; | |
| 2693 data[datacounter++] = settingsGetPointerStandard()->aGF_low; | |
| 2694 data[datacounter++] = 99; | |
| 2695 break; | |
| 2696 | |
| 2697 case 0x28: | |
| 2698 data[datacounter++] = PARAM_PERCENT; | |
| 2699 data[datacounter++] = 45; | |
| 2700 data[datacounter++] = settingsGetPointerStandard()->aGF_high; | |
| 2701 data[datacounter++] = 99; | |
| 2702 break; | |
| 2703 | |
| 2704 case 0x29: | |
| 2705 data[datacounter++] = PARAM_INT8; // conservatism +0 .. +5 | |
| 2706 data[datacounter++] = 0; | |
| 2707 data[datacounter++] = settingsGetPointerStandard()->VPM_conservatism.ub.standard; | |
| 2708 data[datacounter++] = 5; | |
| 2709 break; | |
| 2710 | |
| 2711 case 0x2A: | |
| 2712 case 0x2B: | |
| 2713 data[datacounter++] = PARAM_PERCENT; | |
| 2714 data[datacounter++] = 100; | |
| 2715 data[datacounter++] = 100;// saturation, desaturation, settingsGetPointerStandard()->; | |
| 2716 data[datacounter++] = 100; | |
| 2717 break; | |
| 2718 | |
| 2719 case 0x2C: | |
| 2720 data[datacounter++] = PARAM_INT8; | |
| 2721 data[datacounter++] = 3; | |
| 2722 data[datacounter++] = settingsGetPointerStandard()->last_stop_depth_meter; | |
| 2723 data[datacounter++] = 9; | |
| 2724 break; | |
| 2725 | |
| 2726 case 0x2D: | |
| 2727 data[datacounter++] = PARAM_ENUM; | |
| 2728 data[datacounter++] = 0; | |
| 2729 data[datacounter++] = settingsGetPointerStandard()->brightness; | |
| 2730 data[datacounter++] = 4; | |
| 2731 break; | |
| 2732 | |
| 2733 case 0x2E: | |
| 2734 data[datacounter++] = PARAM_ENUM; | |
| 2735 data[datacounter++] = 0; | |
| 2736 data[datacounter++] = settingsGetPointerStandard()->nonMetricalSystem; | |
| 2737 data[datacounter++] = 1; | |
| 2738 break; | |
| 2739 | |
| 2740 case 0x2F: | |
| 2741 data[datacounter++] = PARAM_INT8; // Sampling rate logbook | |
| 2742 data[datacounter++] = 2; | |
| 2743 data[datacounter++] = 2; | |
| 2744 data[datacounter++] = 2; | |
| 2745 break; | |
| 2746 | |
| 2747 case 0x30: | |
| 2748 data[datacounter++] = PARAM_PERCENT; | |
| 2749 data[datacounter++] = 0; | |
| 2750 data[datacounter++] = settingsGetPointerStandard()->salinity; | |
| 2751 data[datacounter++] = 4; | |
| 2752 break; | |
| 2753 | |
| 2754 case 0x31: | |
| 2755 data[datacounter++] = PARAM_INT8; | |
| 2756 data[datacounter++] = 0; | |
| 2757 data[datacounter++] = settingsGetPointerStandard()->tX_colorscheme; | |
| 2758 data[datacounter++] = 3; | |
| 2759 break; | |
| 2760 | |
| 2761 case 0x32: | |
| 2762 data[datacounter++] = PARAM_ENUM; | |
| 2763 data[datacounter++] = 0; | |
| 2764 data[datacounter++] = settingsGetPointerStandard()->selected_language; | |
| 2765 data[datacounter++] = 1; | |
| 2766 break; | |
| 2767 | |
| 2768 case 0x33: | |
| 2769 data[datacounter++] = PARAM_ENUM; | |
| 2770 data[datacounter++] = 0; | |
| 2771 data[datacounter++] = settingsGetPointerStandard()->date_format; | |
| 2772 data[datacounter++] = 2; | |
| 2773 break; | |
| 2774 | |
| 2775 case 0x34: | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2776 data[datacounter++] = PARAM_SINT; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2777 data[datacounter++] = (uint8_t)-MAX_COMPASS_DECLINATION_DEG; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2778 data[datacounter++] = (uint8_t)settingsGetPointerStandard()->compassDeclinationDeg; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2779 data[datacounter++] = MAX_COMPASS_DECLINATION_DEG; |
| 38 | 2780 break; |
| 2781 | |
| 2782 case 0x35: | |
| 2783 data[datacounter++] = PARAM_SINT; | |
|
337
38367bb982b8
Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents:
334
diff
changeset
|
2784 data[datacounter++] = (uint8_t)(256 - PRESSURE_OFFSET_LIMIT_MBAR); // == -20 |
| 38 | 2785 if(settingsGetPointerStandard()->offsetPressure_mbar < 0) |
| 2786 data[datacounter++] = (uint8_t)(127 - settingsGetPointerStandard()->offsetPressure_mbar); | |
| 2787 else | |
| 2788 data[datacounter++] = settingsGetPointerStandard()->offsetPressure_mbar; | |
|
337
38367bb982b8
Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents:
334
diff
changeset
|
2789 data[datacounter++] = PRESSURE_OFFSET_LIMIT_MBAR; |
| 38 | 2790 break; |
| 2791 | |
| 2792 case 0x36: | |
| 2793 data[datacounter++] = PARAM_BOOL; | |
| 2794 data[datacounter++] = 0; | |
| 2795 if(settingsGetPointerStandard()->safetystopDuration) | |
| 2796 data[datacounter++] = 1; | |
| 2797 else | |
| 2798 data[datacounter++] = 0; | |
| 2799 data[datacounter++] = 1; | |
| 2800 break; | |
| 2801 | |
| 2802 case 0x37: | |
| 2803 data[datacounter++] = PARAM_UNKNOWN ; | |
| 2804 data[datacounter++] = 0; | |
| 2805 data[datacounter++] = 0; // Set calibration gas, not possible with optical | |
| 2806 data[datacounter++] = 0; | |
| 2807 break; | |
| 2808 | |
| 2809 case 0x38: | |
| 2810 data[datacounter++] = PARAM_BOOL; | |
| 2811 data[datacounter++] = 0; | |
| 2812 data[datacounter++] = settingsGetPointerStandard()->fallbackToFixedSetpoint; | |
| 2813 data[datacounter++] = 1; | |
| 2814 break; | |
| 2815 | |
| 2816 case 0x39: | |
| 2817 data[datacounter++] = PARAM_BOOL; | |
| 2818 data[datacounter++] = 0; | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2819 data[datacounter++] = settingsGetPointerStandard()->FlipDisplay; |
|
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
2820 data[datacounter++] = 1; |
| 38 | 2821 break; |
| 2822 | |
| 2823 case 0x3A: | |
| 2824 data[datacounter++] = PARAM_PERCENT; | |
| 2825 data[datacounter++] = 70; | |
| 2826 data[datacounter++] = settingsGetPointerStandard()->ButtonResponsiveness[3]; | |
| 2827 data[datacounter++] = 110; | |
| 2828 break; | |
| 2829 | |
| 2830 case 0x3B: | |
| 2831 data[datacounter++] = PARAM_UNKNOWN; | |
| 2832 data[datacounter++] = 0; | |
| 2833 data[datacounter++] = buttonBalanceTranslateArrayOutHex(settingsGetPointerStandard()->buttonBalance); | |
| 2834 data[datacounter++] = 128; | |
| 2835 break; | |
| 2836 | |
| 2837 case 0x3C: | |
| 2838 data[datacounter++] = PARAM_INT8; | |
| 2839 data[datacounter++] = 5; | |
| 2840 data[datacounter++] = settingsGetPointerStandard()->gasConsumption_bottom_l_min; | |
| 2841 data[datacounter++] = 50; | |
| 2842 break; | |
| 2843 | |
| 2844 case 0x3D: | |
| 2845 data[datacounter++] = PARAM_INT8; | |
| 2846 data[datacounter++] = 5; | |
| 2847 data[datacounter++] = settingsGetPointerStandard()->gasConsumption_deco_l_min; | |
| 2848 data[datacounter++] = 50; | |
| 2849 break; | |
| 2850 | |
| 2851 case 0x3E: | |
| 2852 data[datacounter++] = PARAM_INT8; | |
| 2853 data[datacounter++] = 5; | |
| 2854 data[datacounter++] = settingsGetPointerStandard()->gasConsumption_travel_l_min; | |
| 2855 data[datacounter++] = 50; | |
| 2856 break; | |
| 2857 | |
| 2858 case 0x3F: | |
| 2859 data[datacounter++] = PARAM_UNKNOWN; | |
| 2860 data[datacounter++] = 0; | |
| 2861 data[datacounter++] = 0; // Dynamic ascend rate, not yet :-) settingsGetPointerStandard()->; | |
| 2862 data[datacounter++] = 0; | |
| 2863 break; | |
| 2864 | |
| 2865 case 0x40: | |
| 2866 data[datacounter++] = PARAM_BOOL; | |
| 2867 data[datacounter++] = 1; | |
| 2868 data[datacounter++] = 1; // Graphical speed indicator; | |
| 2869 data[datacounter++] = 1; | |
| 2870 break; | |
| 2871 | |
| 2872 case 0x41: | |
| 2873 data[datacounter++] = PARAM_BOOL; | |
| 2874 data[datacounter++] = 0; | |
| 2875 data[datacounter++] = settingsGetPointerStandard()->alwaysShowPPO2; | |
| 2876 data[datacounter++] = 1; | |
| 2877 break; | |
| 2878 | |
| 2879 case 0x42: | |
| 2880 data[datacounter++] = PARAM_SIGNED|PARAM_CENTI; | |
| 2881 data[datacounter++] = (uint8_t)(256 - 20); // == -20 | |
| 2882 if(settingsGetPointerStandard()->offsetTemperature_centigrad < 0) | |
| 2883 data[datacounter++] = (uint8_t)(127 - settingsGetPointerStandard()->offsetTemperature_centigrad); | |
| 2884 else | |
| 2885 data[datacounter++] = settingsGetPointerStandard()->offsetTemperature_centigrad; | |
| 2886 data[datacounter++] = 20; | |
| 2887 break; | |
| 2888 | |
| 2889 case 0x43: | |
| 2890 newDuration = settingsGetPointerStandard()->safetystopDuration; | |
| 2891 newDuration *= 60; | |
| 2892 if(newDuration > 255) | |
| 2893 newDuration = 255; | |
| 2894 data[datacounter++] = PARAM_INT8; | |
| 2895 data[datacounter++] = 60; // coud be 1 minute instead | |
| 2896 data[datacounter++] = (uint8_t)newDuration; | |
| 2897 data[datacounter++] = 255; // could be 5 minutes instead | |
| 2898 break; | |
| 2899 | |
| 2900 case 0x44: | |
| 2901 data[datacounter++] = PARAM_INT8; | |
| 2902 data[datacounter++] = 30; // coud be 3 meter instead | |
| 2903 data[datacounter++] = settingsGetPointerStandard()->safetystopDepth * 10; | |
| 2904 data[datacounter++] = 60; // could be 6 meter instead | |
| 2905 break; | |
| 2906 | |
| 2907 case 0x45: | |
| 2908 case 0x46: | |
| 2909 data[datacounter++] = PARAM_UNKNOWN; | |
| 2910 data[datacounter++] = 0; | |
| 2911 data[datacounter++] = 0; // SafetyStop End Depth and SafetyStop Reset Depth | |
| 2912 data[datacounter++] = 0; | |
| 2913 break; | |
| 2914 | |
| 2915 case 0x47: | |
| 2916 data[datacounter++] = PARAM_INT15; | |
| 2917 data[datacounter++] = 0; | |
| 2918 data[datacounter++] = 0; | |
| 2919 data[datacounter++] = settingsGetPointerStandard()->logbookOffset & 0xFF; | |
| 2920 data[datacounter++] = settingsGetPointerStandard()->logbookOffset / 0xFF; | |
| 2921 data[datacounter++] = 9000 & 0xFF; | |
| 2922 data[datacounter++] = 9000 / 0xFF; | |
| 2923 break; | |
| 2924 | |
| 2925 case 0x70: | |
| 2926 data[datacounter++] = PARAM_BOOL; | |
| 2927 data[datacounter++] = 0; | |
| 2928 data[datacounter++] = settingsGetPointerStandard()->showDebugInfo; | |
| 2929 data[datacounter++] = 1; | |
| 2930 break; | |
| 2931 | |
| 2932 case 0x71: | |
| 2933 data[datacounter++] = PARAM_ENUM; | |
| 2934 data[datacounter++] = 0; | |
| 2935 data[datacounter++] = settingsGetPointerStandard()->extraDisplay; | |
| 2936 data[datacounter++] = (EXTRADISPLAY_END - 1); | |
| 2937 break; | |
| 2938 | |
| 2939 case 0x72: | |
| 2940 data[datacounter++] = PARAM_ENUM; | |
| 2941 data[datacounter++] = 0; | |
| 2942 data[datacounter++] = settingsGetPointerStandard()->tX_customViewPrimary; | |
| 2943 data[datacounter++] = 8; | |
| 2944 break; | |
| 2945 | |
| 2946 case 0x73: | |
| 2947 data[datacounter++] = PARAM_INT8; | |
| 2948 data[datacounter++] = 0; | |
| 2949 data[datacounter++] = settingsGetPointerStandard()->tX_customViewTimeout; | |
| 2950 data[datacounter++] = 60; | |
| 2951 break; | |
| 2952 | |
| 2953 case 0x74: | |
| 2954 data[datacounter++] = PARAM_ENUM; | |
| 2955 data[datacounter++] = 1; | |
| 2956 data[datacounter++] = settingsGetPointerStandard()->tX_userselectedLeftLowerCornerPrimary; | |
| 2957 data[datacounter++] = 7; | |
| 2958 break; | |
| 2959 | |
| 2960 case 0x75: | |
| 2961 data[datacounter++] = PARAM_INT8; | |
| 2962 data[datacounter++] = 0; | |
| 2963 data[datacounter++] = settingsGetPointerStandard()->tX_userselectedLeftLowerCornerTimeout; | |
| 2964 data[datacounter++] = 60; | |
| 2965 break; | |
| 2966 } | |
| 2967 | |
| 2968 if(datacounter == 0) | |
| 2969 { | |
| 2970 data[datacounter++] = PARAM_UNKNOWN; | |
| 2971 data[datacounter++] = 0; | |
| 2972 data[datacounter++] = 0; // SafetyStop End Depth and SafetyStop Reset Depth | |
| 2973 data[datacounter++] = 0; | |
| 2974 } | |
| 2975 | |
| 2976 return datacounter; | |
| 2977 } | |
| 2978 | |
| 2979 | |
| 2980 uint8_t readData(uint8_t what, uint8_t * data) | |
| 2981 { | |
| 2982 data[0] = 0; | |
| 2983 data[1] = 0; | |
| 2984 data[2] = 0; | |
| 2985 data[3] = 0; | |
| 2986 switch(what) | |
| 2987 { | |
| 2988 case 0x10: | |
| 2989 return getGas(1,data); | |
| 2990 case 0x11: | |
| 2991 return getGas(2,data); | |
| 2992 case 0x12: | |
| 2993 return getGas(3,data); | |
| 2994 case 0x13: | |
| 2995 return getGas(4,data); | |
| 2996 case 0x14: | |
| 2997 return getGas(5,data); | |
| 2998 case 0x15: | |
| 2999 return getDiluent(1,data); | |
| 3000 case 0x16: | |
| 3001 return getDiluent(2,data); | |
| 3002 case 0x17: | |
| 3003 return getDiluent(3,data); | |
| 3004 case 0x18: | |
| 3005 return getDiluent(4,data); | |
| 3006 case 0x19: | |
| 3007 return getDiluent(5,data); | |
| 3008 case 0x1A: | |
| 3009 return getSetpoint(1,data); | |
| 3010 case 0x1B: | |
| 3011 return getSetpoint(2,data); | |
| 3012 case 0x1C: | |
| 3013 return getSetpoint(3,data); | |
| 3014 case 0x1D: | |
| 3015 return getSetpoint(4,data); | |
| 3016 case 0x1E: | |
| 3017 return getSetpoint(5,data); | |
| 3018 case 0x1F: | |
| 3019 data[0] = Settings.CCR_Mode; | |
| 3020 break; | |
| 3021 case 0x20: | |
| 3022 data[0] = Settings.dive_mode; | |
| 3023 break; | |
| 3024 case 0x21: | |
| 3025 data[0] = Settings.deco_type.ub.standard; | |
| 3026 break; | |
| 3027 case 0x22: | |
| 3028 data[0] = Settings.ppO2_max_std; | |
| 3029 break; | |
| 3030 case 0x23: | |
| 3031 data[0] = Settings.ppO2_min; | |
| 3032 break; | |
| 3033 case 0x24: | |
| 3034 data[0] = Settings.future_TTS; | |
| 3035 break; | |
| 3036 case 0x25: | |
| 3037 data[0] = Settings.GF_low; | |
| 3038 break; | |
| 3039 case 0x26: | |
| 3040 data[0] = Settings.GF_high; | |
| 3041 break; | |
| 3042 case 0x27: | |
| 3043 data[0] = Settings.aGF_low; | |
| 3044 break; | |
| 3045 case 0x28: | |
| 3046 data[0] = Settings.aGF_high; | |
| 3047 break; | |
| 3048 case 0x29: | |
| 3049 data[0] = Settings.VPM_conservatism.ub.standard; | |
| 3050 break; | |
| 3051 case 0x2A: | |
| 3052 case 0x2B: | |
| 3053 data[0] = 100; | |
| 3054 break; | |
| 3055 case 0x2C: | |
| 3056 data[0] = Settings.last_stop_depth_meter; | |
| 3057 break; | |
| 3058 case 0x2D: | |
| 3059 data[0] = Settings.brightness; | |
| 3060 break; | |
| 3061 case 0x2E: | |
| 3062 data[0] = Settings.nonMetricalSystem; | |
| 3063 break; | |
| 3064 case 0x2F: | |
| 3065 data[0] = 0; // 0 == 2 sec sampling rate | |
| 3066 break; | |
| 3067 case 0x30: | |
| 3068 data[0] = Settings.salinity; | |
| 3069 break; | |
| 3070 case 0x31: | |
| 3071 data[0] = Settings.tX_colorscheme; | |
| 3072 break; | |
| 3073 case 0x32: | |
| 3074 data[0] = Settings.selected_language; | |
| 3075 break; | |
| 3076 case 0x33: | |
| 3077 data[0] = Settings.date_format; | |
| 3078 break; | |
| 3079 case 0x34: | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
3080 data[0] = (uint8_t)Settings.compassDeclinationDeg; |
| 38 | 3081 break; |
| 3082 case 0x35: | |
| 3083 data[0] = Settings.offsetPressure_mbar; | |
| 3084 break; | |
| 3085 case 0x36: | |
| 3086 if(Settings.safetystopDepth) | |
| 3087 data[0] = 1; | |
| 3088 else | |
| 3089 data[0] = 0; | |
| 3090 break; | |
| 3091 case 0x37: | |
| 3092 data[0] = 0; // calibration gas %O2 -> 0 no gas :-) | |
| 3093 break; | |
| 3094 case 0x38: | |
| 3095 data[0] = Settings.fallbackToFixedSetpoint; | |
| 3096 break; | |
| 3097 case 0x39: | |
|
993
df052f0347fb
Add settings that have been missing in the bluetooth API:
heinrichsweikamp
parents:
990
diff
changeset
|
3098 data[0] = Settings.FlipDisplay; |
| 38 | 3099 break; |
| 3100 case 0x3A: | |
| 3101 data[0] = Settings.ButtonResponsiveness[3]; | |
| 3102 break; | |
| 3103 case 0x3B: | |
| 3104 data[0] = buttonBalanceTranslateArrayOutHex(settingsGetPointer()->buttonBalance); | |
| 3105 break; | |
| 3106 case 0x3C: | |
| 3107 data[0] = Settings.gasConsumption_bottom_l_min; | |
| 3108 break; | |
| 3109 case 0x3D: | |
| 3110 data[0] = Settings.gasConsumption_deco_l_min; | |
| 3111 break; | |
| 3112 case 0x3E: | |
| 3113 data[0] = Settings.gasConsumption_travel_l_min; | |
| 3114 break; | |
| 3115 case 0x3F: | |
| 3116 data[0] = 0; // fixed ascend rate 10 m/min | |
| 3117 break; | |
| 3118 case 0x40: | |
| 3119 data[0] = 1; // graphical speed indicator | |
| 3120 break; | |
| 3121 case 0x41: | |
| 3122 data[0] = Settings.alwaysShowPPO2; | |
| 3123 break; | |
| 3124 case 0x42: | |
| 3125 data[0] = Settings.offsetTemperature_centigrad; | |
| 3126 break; | |
| 3127 case 0x43: | |
| 3128 if(Settings.safetystopDuration > 4) | |
| 3129 data[0] = 255; // seconds | |
| 3130 else | |
| 3131 data[0] = 60 * Settings.safetystopDuration; | |
| 3132 break; | |
| 3133 case 0x44: | |
| 3134 data[0] = Settings.safetystopDepth * 10; // cbar instead of meter | |
| 3135 break; | |
| 3136 case 0x45: | |
| 3137 if(Settings.safetystopDepth == 3) | |
| 3138 data[0] = 20; // cbar | |
| 3139 else | |
| 3140 data[0] = 30; // cbar | |
| 3141 break; | |
| 3142 case 0x46: | |
| 3143 data[0] = 10; // reset at 10 meter as far as I understood | |
| 3144 break; | |
| 3145 case 0x47: | |
| 3146 data[0] = Settings.logbookOffset & 0xFF; | |
| 3147 data[1] = Settings.logbookOffset / 0xFF; | |
| 3148 break; | |
| 3149 case 0x70: | |
| 3150 data[0] = Settings.showDebugInfo; | |
| 3151 break; | |
| 3152 case 0x71: | |
| 3153 data[0] = Settings.extraDisplay; | |
| 3154 break; | |
| 3155 case 0x72: | |
| 3156 data[0] = Settings.tX_customViewPrimary; | |
| 3157 break; | |
| 3158 case 0x73: | |
| 3159 data[0] = Settings.tX_customViewTimeout; | |
| 3160 break; | |
| 3161 case 0x74: | |
| 3162 data[0] = Settings.tX_userselectedLeftLowerCornerPrimary; | |
| 3163 break; | |
| 3164 case 0x75: | |
| 3165 data[0] = Settings.tX_userselectedLeftLowerCornerTimeout; | |
| 3166 break; | |
| 3167 } | |
| 3168 return 0x4D; | |
| 3169 } | |
| 3170 | |
| 3171 | |
| 3172 uint8_t RTEminimum_required_high(void) | |
| 3173 { | |
| 3174 return RTErequiredHigh; | |
| 3175 } | |
| 3176 uint8_t RTEminimum_required_low(void) | |
| 3177 { | |
| 3178 return RTErequiredLow; | |
| 3179 } | |
| 3180 | |
| 3181 uint8_t FONTminimum_required_high(void) | |
| 3182 { | |
| 3183 return FONTrequiredHigh; | |
| 3184 } | |
| 3185 uint8_t FONTminimum_required_low(void) | |
| 3186 { | |
| 3187 return FONTrequiredLow; | |
| 3188 } | |
| 3189 | |
| 3190 | |
| 3191 void setActualRTEversion(uint8_t high, uint8_t low) | |
| 3192 { | |
| 3193 RTEactualHigh = high; | |
| 3194 RTEactualLow = low; | |
| 3195 } | |
| 3196 | |
| 870 | 3197 #ifndef BOOTLOADER_STANDALONE |
| 38 | 3198 void getActualRTEandFONTversion(uint8_t *RTEhigh, uint8_t *RTElow, uint8_t *FONThigh, uint8_t *FONTlow) |
| 3199 { | |
| 3200 if(RTEhigh && RTElow) | |
| 3201 { | |
| 3202 *RTEhigh = RTEactualHigh; | |
| 3203 *RTElow = RTEactualLow; | |
| 3204 } | |
| 3205 if(FONThigh && FONTlow) | |
| 3206 { | |
| 3207 *FONThigh = *(uint8_t *)0x08132000; | |
| 3208 *FONTlow = *(uint8_t *)0x08132001; | |
| 3209 } | |
| 3210 } | |
| 3211 | |
| 3212 | |
| 3213 uint8_t getLicence(void) | |
| 3214 { | |
| 3215 return hardwareDataGetPointer()->primaryLicence; | |
| 3216 } | |
| 870 | 3217 #endif |
| 38 | 3218 |
| 3219 void firmwareGetDate(RTC_DateTypeDef *SdateOutput) | |
| 3220 { | |
| 3221 SdateOutput->Year = firmwareDataGetPointer()->release_year; | |
| 3222 SdateOutput->Month = firmwareDataGetPointer()->release_month; | |
| 3223 SdateOutput->Date = firmwareDataGetPointer()->release_day; | |
| 3224 } | |
| 3225 | |
| 3226 | |
| 3227 // this should use device specific values stored in OTPROG ROM soon | |
| 3228 void getButtonFactorDefaults(uint8_t* basePercentage, uint8_t* buttonBalanceArray) | |
| 3229 { | |
| 3230 *basePercentage = settingsGetPointerStandard()->ButtonResponsiveness[3]; | |
| 3231 | |
| 3232 for(int i=0;i<3;i++) | |
| 3233 { | |
| 3234 buttonBalanceArray[i] = settingsGetPointerStandard()->buttonBalance[i]; | |
| 3235 } | |
| 3236 } | |
| 3237 | |
| 3238 | |
| 3239 uint8_t buttonBalanceTranslatorHexToArray(uint8_t hexValue, uint8_t* outputArray) | |
| 3240 { | |
| 3241 if(hexValue > 127) | |
| 3242 return 0; | |
| 3243 // internal order: 0 = right, 1 = center, 2 = left | |
| 3244 // external order: Factory,left,center,right | |
| 3245 outputArray[0] = 2 + (hexValue & 0x03); | |
| 3246 hexValue /= 4; | |
| 3247 outputArray[1] = 2 + (hexValue & 0x03); | |
| 3248 hexValue /= 4; | |
| 3249 outputArray[2] = 2 + (hexValue & 0x03); | |
| 3250 | |
| 3251 return 1; | |
| 3252 } | |
| 3253 | |
| 3254 | |
| 3255 uint8_t buttonBalanceTranslateArrayOutHex(const uint8_t* inputArray) | |
| 3256 { | |
| 3257 uint8_t hexValue = 0; | |
| 3258 | |
| 3259 if(inputArray[2] > 2) | |
| 3260 { | |
| 3261 hexValue += inputArray[2] - 2; | |
| 3262 } | |
| 3263 hexValue *= 4; | |
| 3264 | |
| 3265 if(inputArray[1] > 2) | |
| 3266 { | |
| 3267 hexValue += inputArray[1] - 2; | |
| 3268 } | |
| 3269 hexValue *= 4; | |
| 3270 if(inputArray[0] > 2) | |
| 3271 { | |
| 3272 hexValue += inputArray[0] - 2; | |
| 3273 } | |
| 3274 return hexValue; | |
| 3275 } | |
| 3276 | |
| 3277 void settingsWriteFactoryDefaults(uint8_t inputValueRaw, uint8_t *inputBalanceArray) | |
| 3278 { | |
| 3279 if((inputValueRaw >= 70) && (inputValueRaw <= 110)) | |
| 3280 { | |
| 3281 Settings.FactoryButtonBase = inputValueRaw; | |
| 3282 } | |
| 3283 for(int i=0;i<3;i++) | |
| 3284 { | |
| 3285 if((inputBalanceArray[i] >= 2) && (inputBalanceArray[i] <= 5)) | |
| 3286 { | |
| 3287 Settings.FactoryButtonBalance[i] = inputBalanceArray[i]; | |
| 3288 } | |
| 3289 } | |
| 3290 } | |
| 3291 | |
| 3292 | |
| 3293 /** | |
| 3294 ****************************************************************************** | |
| 3295 * @brief settingsHelperButtonSens. / make 32 bit input to three buttons + storage value in [3] | |
| 3296 * @author heinrichs weikamp gmbh | |
| 3297 * @version V 01 | |
| 3298 * @date 19-Sept-2016 | |
| 3299 ****************************************************************************** | |
| 3300 * | |
| 3301 * @param inputValueRaw: | |
| 3302 * @param outArray4Values: [0] is right, [1] is center, [2] is left, [3] is original value with zero balance | |
| 3303 * @retval None | |
| 3304 */ | |
| 3305 void settingsHelperButtonSens_keepPercentageValues(uint32_t inputValueRaw, uint8_t *outArray4Values) | |
| 3306 { | |
| 3307 uint32_t newSensitivity; | |
| 3308 | |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
3309 if(inputValueRaw > MAX_BUTTONRESPONSIVENESS) |
| 38 | 3310 { |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
3311 inputValueRaw = MAX_BUTTONRESPONSIVENESS; |
| 38 | 3312 } |
| 3313 else | |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
3314 if(inputValueRaw < MIN_BUTTONRESPONSIVENESS) |
| 38 | 3315 { |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
3316 inputValueRaw = MIN_BUTTONRESPONSIVENESS; |
| 38 | 3317 } |
| 3318 | |
| 3319 // the unbalanced value | |
| 3320 outArray4Values[3] = inputValueRaw; | |
| 3321 | |
| 3322 // the balanced values | |
| 3323 for(int i=0;i<3;i++) | |
| 3324 { | |
| 3325 newSensitivity = inputValueRaw; | |
| 3326 switch(settingsGetPointer()->buttonBalance[i]) | |
| 3327 { | |
| 3328 case 1: // should not be an option hw 170508 | |
| 3329 newSensitivity -= 20; | |
| 3330 break; | |
| 3331 case 2: | |
| 3332 newSensitivity -= 10; | |
| 3333 break; | |
| 3334 default: | |
| 3335 break; | |
| 3336 case 4: | |
| 3337 newSensitivity += 10; | |
| 3338 break; | |
| 3339 case 5: | |
| 3340 newSensitivity += 20; | |
| 3341 break; | |
| 3342 } | |
| 3343 | |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
3344 if(newSensitivity > MAX_BUTTONRESPONSIVENESS) |
| 38 | 3345 { |
|
92
be35821a4974
Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents:
91
diff
changeset
|
3346 newSensitivity = MAX_BUTTONRESPONSIVENESS; |
| 38 | 3347 } |
| 3348 outArray4Values[i] = newSensitivity; | |
| 3349 } | |
| 3350 } | |
| 3351 | |
| 3352 | |
| 3353 /** | |
| 3354 ****************************************************************************** | |
| 3355 * @brief settingsHelperButtonSens_translate_to_hwOS_values. / make 32 bit input to three buttons + storage value in [3] | |
| 3356 * @author heinrichs weikamp gmbh | |
| 3357 * @version V 01 | |
| 3358 * @date 19-Sept-2016 | |
| 3359 ****************************************************************************** | |
| 3360 * | |
| 3361 * @param inputValueRaw: | |
| 3362 * @param outArray4Values: [0] is right, [1] is center, [2] is left, [3] is original value with zero balance | |
| 3363 * @retval None | |
| 3364 */ | |
| 3365 void settingsHelperButtonSens_original_translate_to_hwOS_values(const uint32_t inputValueRaw, uint8_t *outArray4Values) | |
| 3366 { | |
| 3367 uint32_t newSensitivity; | |
| 3368 | |
| 3369 for(int i=0;i<3;i++) | |
| 3370 { | |
| 3371 newSensitivity = inputValueRaw; | |
| 3372 switch(settingsGetPointer()->buttonBalance[i]) | |
| 3373 { | |
| 3374 case 1: | |
| 3375 newSensitivity -= 20; | |
| 3376 break; | |
| 3377 case 2: | |
| 3378 newSensitivity -= 10; | |
| 3379 break; | |
| 3380 default: | |
| 3381 break; | |
| 3382 case 4: | |
| 3383 newSensitivity += 10; | |
| 3384 break; | |
| 3385 case 5: | |
| 3386 newSensitivity += 20; | |
| 3387 break; | |
| 3388 } | |
| 3389 | |
| 3390 if(newSensitivity > 100) | |
| 3391 { | |
| 3392 if(newSensitivity <= 105) | |
| 3393 newSensitivity = 10; | |
| 3394 else | |
| 3395 newSensitivity = 7; | |
| 3396 } | |
| 3397 else | |
| 3398 { | |
| 3399 newSensitivity *= 24; | |
| 3400 newSensitivity = 2400 - newSensitivity; | |
| 3401 newSensitivity /= 10; | |
| 3402 | |
| 3403 newSensitivity += 15; | |
| 3404 if(newSensitivity > 255) | |
| 3405 newSensitivity = 255; | |
| 3406 } | |
| 3407 outArray4Values[i] = newSensitivity; | |
| 3408 } | |
| 3409 | |
| 3410 // the unbalanced value | |
| 3411 newSensitivity = inputValueRaw; | |
| 3412 if(newSensitivity > 100) | |
| 3413 { | |
| 3414 if(newSensitivity <= 105) | |
| 3415 newSensitivity = 10; | |
| 3416 else | |
| 3417 newSensitivity = 7; | |
| 3418 } | |
| 3419 else | |
| 3420 { | |
| 3421 newSensitivity *= 24; | |
| 3422 newSensitivity = 2400 - newSensitivity; | |
| 3423 newSensitivity /= 10; | |
| 3424 | |
| 3425 newSensitivity += 15; | |
| 3426 if(newSensitivity > 255) | |
| 3427 newSensitivity = 255; | |
| 3428 } | |
| 3429 outArray4Values[3] = newSensitivity; | |
| 3430 } | |
| 3431 | |
| 3432 | |
| 3433 /** | |
| 3434 ****************************************************************************** | |
| 3435 * @brief settingsHelperButtonSens_translate_percentage_to_hwOS_values. | |
| 3436 * @author heinrichs weikamp gmbh | |
| 3437 * @version V 01 | |
| 3438 * @date 6-March-2017 | |
| 3439 ****************************************************************************** | |
| 3440 * | |
| 3441 * @param inputValuePercentage with buttonBalance included | |
| 3442 * @retval PIC compatible value | |
| 3443 */ | |
| 3444 uint8_t settingsHelperButtonSens_translate_percentage_to_hwOS_values(uint8_t inputValuePercentage) | |
| 3445 { | |
| 3446 uint32_t newSensitivity = inputValuePercentage; | |
| 3447 | |
| 3448 if(newSensitivity > 100) | |
| 3449 { | |
| 3450 if(newSensitivity <= 105) | |
| 3451 newSensitivity = 10; | |
| 3452 else | |
| 3453 newSensitivity = 7; | |
| 3454 } | |
| 3455 else | |
| 3456 { | |
| 3457 newSensitivity *= 24; | |
| 3458 newSensitivity = 2400 - newSensitivity; | |
| 3459 newSensitivity /= 10; | |
| 3460 | |
| 3461 newSensitivity += 15; | |
| 3462 if(newSensitivity > 255) | |
| 3463 newSensitivity = 255; | |
| 3464 } | |
| 3465 return (uint8_t)newSensitivity; | |
| 3466 } | |
| 3467 | |
| 3468 | |
| 3469 /** | |
| 3470 ****************************************************************************** | |
| 3471 * @brief settingsHelperButtonSens_translate_hwOS_values_to_percentage. | |
| 3472 * @author heinrichs weikamp gmbh | |
| 3473 * @version V 01 | |
| 3474 * @date 6-March-2017 | |
| 3475 ****************************************************************************** | |
| 3476 * | |
| 3477 * @param PIC compatible value | |
| 3478 * @retval Percentage | |
| 3479 */ | |
| 3480 uint8_t settingsHelperButtonSens_translate_hwOS_values_to_percentage(uint8_t inputValuePIC) | |
| 3481 { | |
| 3482 if(inputValuePIC >= 15) | |
| 3483 { | |
| 3484 return(uint8_t)((25500 - (inputValuePIC)*100) / 240); | |
| 3485 } | |
| 3486 else | |
| 3487 { | |
| 3488 if(inputValuePIC >= 10) | |
| 3489 { | |
| 3490 return 105; | |
| 3491 } | |
| 3492 else | |
| 3493 { | |
| 3494 return 110; | |
| 3495 } | |
| 3496 } | |
| 3497 } | |
| 662 | 3498 |
| 3499 void reset_SettingWarning() | |
| 3500 { | |
| 3501 settingsWarning = 0; | |
| 3502 } | |
|
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
|
3503 |
| 662 | 3504 inline uint8_t isSettingsWarning() |
| 3505 { | |
| 3506 return settingsWarning; | |
| 3507 } | |
|
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
|
3508 |
|
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 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
|
3510 { |
|
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
|
3511 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
|
3512 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
|
3513 } |
|
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 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
|
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 |
|
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 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
|
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 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
|
3521 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
|
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 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
|
3525 } |
| 1027 | 3526 |
