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