annotate Discovery/Src/settings.c @ 664:667093daa937 Betatest

Stability improvment bluetooth startup: The previous implementation expected a default setup of the Bluetooth module. Deviations from the default expectation caused the init function to stop. The new implementation is able to fix wrong baud rate setting (reset baudrate to default 115200). In addition the function evaluating the answers of the module is not able to derive the status out of a data stream.
author Ideenmodellierer
date Tue, 21 Dec 2021 19:36:41 +0100
parents 1b995079c045
children 12d029f38430
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 /// -*- coding: UTF-8 -*-
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 /// \file Discovery/Src/settings.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief settingsHelperButtonSens_translate_hwOS_values_to_percentage.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 /// \author Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 /// \date 6-March-2017
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 /// \details
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 /// $Id$
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 /// This program is free software: you can redistribute it and/or modify
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 /// it under the terms of the GNU General Public License as published by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 /// the Free Software Foundation, either version 3 of the License, or
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 /// (at your option) any later version.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 /// This program is distributed in the hope that it will be useful,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 /// GNU General Public License for more details.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 /// You should have received a copy of the GNU General Public License
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 //////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 #include <string.h>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 #include "settings.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 #include "firmwareEraseProgram.h" // for HARDWAREDATA_ADDRESS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 #include "externLogbookFlash.h" // for SAMPLESTART and SAMPLESTOP
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "text_multilanguage.h" // for LANGUAGE_END
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 #include "tHome.h" // for CVIEW_END
389
ebc2b571a0b9 Fix case for case sensitive OS
Jan Mulder <jan@jlmulder.nl>
parents: 382
diff changeset
35 #include "motion.h"
443
a5101c688b49 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 439
diff changeset
36 #include "t7.h"
539
d784f281833a Added inertia simulation for compass heading:
Ideenmodellierer
parents: 533
diff changeset
37 #include "data_central.h"
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
39 static uint8_t settingsWarning = 0; /* Active if setting values have been corrected */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
40
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 SSettings Settings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42
431
49c3c5f0d0cb make a 1.5.3 for tests
heinrichsweikamp
parents: 417
diff changeset
43 const uint8_t RTErequiredHigh = 2;
644
ebe3fc302ab8 Compile with ENABLE_CHARGER_STATUS_V2
heinrichs weikamp
parents: 639
diff changeset
44 const uint8_t RTErequiredLow = 7;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45
75
2b3f8ed4a0b8 Update version info
Ideenmodellierer
parents: 70
diff changeset
46 const uint8_t FONTrequiredHigh = 1;
2b3f8ed4a0b8 Update version info
Ideenmodellierer
parents: 70
diff changeset
47 const uint8_t FONTrequiredLow = 0;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 uint8_t RTEactualHigh = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 uint8_t RTEactualLow = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 // SFirmwareData FirmwareData
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 /// @brief internal counter is for changes after last release
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 /// use date and info as well for this purpose
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 const SFirmwareData firmware_FirmwareData __attribute__( (section(".firmware_firmware_data")) ) =
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 .versionFirst = 1,
334
143fe85f82a2 building a 1.5
heinrichsweikamp
parents: 324
diff changeset
62 .versionSecond = 5,
644
ebe3fc302ab8 Compile with ENABLE_CHARGER_STATUS_V2
heinrichs weikamp
parents: 639
diff changeset
63 .versionThird = 8,
657
9513a92b293b Update release date
heinrichs weikamp
parents: 654
diff changeset
64 .versionBeta = 1,
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 /* 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
67 .signature = "mh",
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68
606
06ec1da5e105 1.5.6 release
heinrichsweikamp
parents: 588
diff changeset
69 .release_year = 21,
657
9513a92b293b Update release date
heinrichs weikamp
parents: 654
diff changeset
70 .release_month = 04,
9513a92b293b Update release date
heinrichs weikamp
parents: 654
diff changeset
71 .release_day = 26,
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 .release_sub = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 /* max 48 with trailing 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 //release_info ="12345678901234567890123456789012345678901"
286
733877ab87d9 Minor: Some Texts fixed, allign RTErequired* values with RTE firmware
heinrichsweikamp
parents: 274
diff changeset
76 .release_info ="gcc_2nd",
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 /* for safety reasons and coming functions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 .magic[0] = FIRMWARE_MAGIC_FIRST,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 .magic[1] = FIRMWARE_MAGIC_SECOND,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 .magic[2] = FIRMWARE_MAGIC_FIRMWARE, /* the magic byte */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 .magic[3] = FIRMWARE_MAGIC_END
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 /* always adjust check_and_correct_settings() accordingly
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 * There might even be entries with fixed values that have no range
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 const SSettings SettingsStandard = {
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
90 .header = 0xFFFF0021,
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 .warning_blink_dsec = 8 * 2,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 .lastDiveLogId = 0,
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
93 .logFlashNextSampleStartAddress = SAMPLESTART,
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 .gas[0].oxygen_percentage = 21,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 .gas[1].oxygen_percentage = 21,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 .gas[2].oxygen_percentage = 21,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 .gas[3].oxygen_percentage = 21,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 .gas[4].oxygen_percentage = 21,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 .gas[5].oxygen_percentage = 21,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 .gas[6].oxygen_percentage = 21,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 .gas[7].oxygen_percentage = 21,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 .gas[8].oxygen_percentage = 21,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 .gas[9].oxygen_percentage = 21,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 .gas[10].oxygen_percentage = 21,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 .gas[0].helium_percentage = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 .gas[1].helium_percentage = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 .gas[2].helium_percentage = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 .gas[3].helium_percentage = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 .gas[4].helium_percentage = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 .gas[5].helium_percentage = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 .gas[6].helium_percentage = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 .gas[7].helium_percentage = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 .gas[8].helium_percentage = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 .gas[9].helium_percentage = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 .gas[10].helium_percentage = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 .gas[0].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 .gas[1].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 .gas[2].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 .gas[3].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 .gas[4].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 .gas[5].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 .gas[6].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 .gas[7].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 .gas[8].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 .gas[9].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 .gas[10].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 .gas[0].depth_meter_travel = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 .gas[1].depth_meter_travel = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 .gas[2].depth_meter_travel = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 .gas[3].depth_meter_travel = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 .gas[4].depth_meter_travel = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 .gas[5].depth_meter_travel = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 .gas[6].depth_meter_travel = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 .gas[7].depth_meter_travel = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 .gas[8].depth_meter_travel = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 .gas[9].depth_meter_travel = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 .gas[10].depth_meter_travel = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 .gas[0].note.uw = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 .gas[1].note.ub.first = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 .gas[1].note.ub.active = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 .gas[1].note.ub.deco = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 .gas[1].note.ub.travel = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 .gas[2].note.uw = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 .gas[3].note.uw = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 .gas[4].note.uw = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 .gas[5].note.uw = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 .gas[6].note.ub.first = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 .gas[6].note.ub.active = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 .gas[6].note.ub.deco = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 .gas[6].note.ub.travel = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 .gas[7].note.uw = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 .gas[8].note.uw = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 .gas[9].note.uw = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 .gas[10].note.uw = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 .gas[0].bottle_size_liter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 .gas[1].bottle_size_liter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 .gas[2].bottle_size_liter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 .gas[3].bottle_size_liter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 .gas[4].bottle_size_liter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 .gas[5].bottle_size_liter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 .gas[6].bottle_size_liter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 .gas[7].bottle_size_liter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 .gas[8].bottle_size_liter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 .gas[9].bottle_size_liter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 .gas[10].bottle_size_liter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 .gas[0].bottle_wireless_status = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 .gas[1].bottle_wireless_status = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 .gas[2].bottle_wireless_status = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 .gas[3].bottle_wireless_status = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 .gas[4].bottle_wireless_status = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 .gas[5].bottle_wireless_status = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 .gas[6].bottle_wireless_status = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 .gas[7].bottle_wireless_status = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 .gas[8].bottle_wireless_status = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 .gas[9].bottle_wireless_status = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 .gas[10].bottle_wireless_status = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 .gas[0].bottle_wireless_id = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 .gas[1].bottle_wireless_id = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 .gas[2].bottle_wireless_id = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 .gas[3].bottle_wireless_id = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 .gas[4].bottle_wireless_id = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 .gas[5].bottle_wireless_id = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 .gas[6].bottle_wireless_id = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 .gas[7].bottle_wireless_id = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 .gas[8].bottle_wireless_id = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 .gas[9].bottle_wireless_id = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 .gas[10].bottle_wireless_id = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 .setpoint[0].setpoint_cbar = 100,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 .setpoint[1].setpoint_cbar = 70,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 .setpoint[2].setpoint_cbar = 90,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 .setpoint[3].setpoint_cbar = 100,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 .setpoint[4].setpoint_cbar = 120,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 .setpoint[5].setpoint_cbar = 140,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 .setpoint[0].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 .setpoint[1].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 .setpoint[2].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 .setpoint[3].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 .setpoint[4].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 .setpoint[5].depth_meter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 .setpoint[0].note.uw = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 .setpoint[1].note.ub.active = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 .setpoint[1].note.ub.first = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 .setpoint[2].note.ub.active = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 .setpoint[2].note.ub.first = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 .setpoint[3].note.ub.active = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 .setpoint[3].note.ub.first = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 .setpoint[4].note.ub.active = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 .setpoint[4].note.ub.first = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 .setpoint[5].note.ub.active = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 .setpoint[5].note.ub.first = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 .CCR_Mode = CCRMODE_Sensors,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 .dive_mode = DIVEMODE_OC,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 .deco_type.ub.standard = GF_MODE,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 .deco_type.ub.alternative = GF_MODE,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 .ppO2_max_deco = 160,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 .ppO2_max_std = 140,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 .ppO2_min = 15,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 .CNS_max = 90,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 .ascent_MeterPerMinute_max = 30,
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
224 .ascent_MeterPerMinute_showGraph = 30,
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 .future_TTS = 5,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 .GF_high = 85,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 .GF_low = 30,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 .aGF_high = 95,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 .aGF_low = 95,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 .VPM_conservatism.ub.standard = 2,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 .VPM_conservatism.ub.alternative = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 .safetystopDuration = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 .AtemMinutenVolumenLiter = 25,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 .ReserveFractionDenominator = 4,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 .salinity = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 .last_stop_depth_meter = 3,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 .stop_increment_depth_meter = 3,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 .brightness = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 .date_format = DDMMYY,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 .selected_language = 0, /* 0 = LANGUAGE_English */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 .customtext = " <your name>\n" " <address>",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 .timeoutSurfacemode = 120,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 .timeoutMenuSurface = 120,//240,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 .timeoutMenuDive = 120,//20,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 .timeoutMenuEdit = 120,//40,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 .timeoutInfo = 120,//60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 .timeoutInfoCompass = 60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 .design = 7,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 .timeoutDiveReachedZeroDepth = 300,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 .divetimeToCreateLogbook = 60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 .serialHigh = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 .serialLow = 2,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 .firmwareVersion16to32bit.ub.first = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 .firmwareVersion16to32bit.ub.second = 6,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 .firmwareVersion16to32bit.ub.third = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 .firmwareVersion16to32bit.ub.betaFlag = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 .backup_localtime_rtc_tr = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 .backup_localtime_rtc_dr = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 .totalDiveCounter = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 .personalDiveCount = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 .showDebugInfo = 0,
92
be35821a4974 Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents: 91
diff changeset
264 .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
265 .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
266 .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
267 .ButtonResponsiveness[3] = DEFAULT_BUTTONRESPONSIVENESS_GUI, // new hw 170306
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 .nonMetricalSystem = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 .fallbackToFixedSetpoint = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 .bluetoothActive = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 .safetystopDepth = 5,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 .updateSettingsAllowedFromHeader = 0xFFFF0002,
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
273 .pscr_lung_ratio = 10,
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
274 .pscr_o2_drop = 4,
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
275 .co2_sensor_active = 0,
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 .ppo2sensors_deactivated = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 .tX_colorscheme = 0,
443
a5101c688b49 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 439
diff changeset
278 .tX_userselectedLeftLowerCornerPrimary = LLC_Temperature,
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 .tX_userselectedLeftLowerCornerTimeout = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 .tX_customViewPrimary = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 .tX_customViewTimeout = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 .timeoutEnterButtonSelectDive = 10,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 .logbookOffset = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 .alwaysShowPPO2 = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 .extraDisplay = EXTRADISPLAY_BIGFONT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 .display_toogle_desc = 200,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 .offsetPressure_mbar = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 .offsetTemperature_centigrad = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 .gasConsumption_travel_l_min = 30,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 .gasConsumption_bottom_l_min = 30,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 .gasConsumption_deco_l_min = 20,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 .debugModeOnStart = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 .compassBearing = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 .lastKnownBatteryPercentage = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 .buttonBalance[0] = 3,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 .buttonBalance[1] = 3,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 .buttonBalance[2] = 3,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 .firmwareVersion[0] = 0,//FirmwareData.firmwareVersion16to32bit.ub.first,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 .firmwareVersion[1] = 0,//FirmwareData.firmwareVersion16to32bit.ub.second,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 .firmwareVersion[2] = 0,//FirmwareData.firmwareVersion16to32bit.ub.third,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 .firmwareVersion[3] = 0,//FirmwareData.firmwareVersion16to32bit.ub.betaFlag,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 .timeoutSurfacemodeWithSensors = 600,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 .VPM_model = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 .GF_model = 0,
92
be35821a4974 Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents: 91
diff changeset
305 .FactoryButtonBase = DEFAULT_BUTTONRESPONSIVENESS_GUI,
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 .FactoryButtonBalance[0] = 3,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 .FactoryButtonBalance[1] = 3,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 .FactoryButtonBalance[2] = 3,
111
38785aa95837 Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents: 75
diff changeset
309 .FlipDisplay = 0,
210
b2a9e9b02df0 New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents: 172
diff changeset
310 .cv_configuration = 0xFFFFFFFF,
375
4bb5ceebfaf9 Use Enum values for initialization and setting check:
ideenmodellierer
parents: 372
diff changeset
311 .MotionDetection = MOTION_DETECT_OFF,
498
4811f3dfaa52 Added dew parameter to enable selection of customer BigFont screens to be displayed
Ideenmodellierer
parents: 492
diff changeset
312 .cv_config_BigScreen = 0xFFFFFFFF,
539
d784f281833a Added inertia simulation for compass heading:
Ideenmodellierer
parents: 533
diff changeset
313 .compassInertia = 0,
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 539
diff changeset
314 .tX_customViewPrimaryBF = CVIEW_T3_Decostop,
546
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
315 .viewPortMode = 0,
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
316 .viewRoll = 0,
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
317 .viewPitch = 0,
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
318 .viewYaw = 0,
560
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
319 .ppo2sensors_source = 0,
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
320 .ppo2sensors_calibCoeff[0] = 0.0,
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
321 .ppo2sensors_calibCoeff[1] = 0.0,
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
322 .ppo2sensors_calibCoeff[2] = 0.0,
567
1c95f811967c -Add 12HR Time Support
izzni
parents: 560
diff changeset
323 .amPMTime = 0,
650
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
324 .autoSetpoint = 0,
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
325 .scrubTimerMax = 0,
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
326 .scrubTimerCur = 0,
654
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 652
diff changeset
327 .scrubTimerMode = SCRUB_TIMER_OFF,
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 /* Functions -----------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 // set_new_settings_missing_in_ext_flash
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 /// @brief Add all the new setting variables of this version
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 /// or/and change what has changed in the meantime
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 /// Additionally update the serial number if written via bluetooth
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 void set_new_settings_missing_in_ext_flash(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 // never delete this part setting the serial
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 if(hardwareDataGetPointer()->secondarySerial != 0xFFFF)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 settingsGetPointer()->serialHigh = (hardwareDataGetPointer()->secondarySerial / 256);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 settingsGetPointer()->serialLow = (hardwareDataGetPointer()->secondarySerial & 0xFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 if(hardwareDataGetPointer()->primarySerial != 0xFFFF)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 settingsGetPointer()->serialHigh = (hardwareDataGetPointer()->primarySerial / 256);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 settingsGetPointer()->serialLow = (hardwareDataGetPointer()->primarySerial & 0xFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 settingsGetPointer()->serialHigh = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 settingsGetPointer()->serialLow = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 settingsGetPointer()->firmwareVersion[0] = firmware_FirmwareData.versionFirst;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 settingsGetPointer()->firmwareVersion[1] = firmware_FirmwareData.versionSecond;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 settingsGetPointer()->firmwareVersion[2] = firmware_FirmwareData.versionThird;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 settingsGetPointer()->firmwareVersion[3] = firmware_FirmwareData.versionBeta;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 SSettings* pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 const SSettings* pStandard = settingsGetPointerStandard();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371
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
372 /* Pointing to the old header data => set new data depending on what had been added since last version */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 switch(pSettings->header)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 case 0xFFFF0000:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 case 0xFFFF0001:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 case 0xFFFF0002:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 case 0xFFFF0003:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 case 0xFFFF0004:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 case 0xFFFF0005:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 pSettings->ppo2sensors_deactivated = pStandard->ppo2sensors_deactivated;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 pSettings->tX_colorscheme = pStandard->tX_colorscheme;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 pSettings->tX_userselectedLeftLowerCornerPrimary = pStandard->tX_userselectedLeftLowerCornerPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 pSettings->tX_userselectedLeftLowerCornerTimeout = pStandard->tX_userselectedLeftLowerCornerTimeout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 pSettings->tX_customViewPrimary = pStandard->tX_customViewPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 pSettings->tX_customViewTimeout = pStandard->tX_customViewTimeout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387 // no break
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 case 0xFFFF0006:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 pSettings->timeoutEnterButtonSelectDive = pStandard->timeoutEnterButtonSelectDive;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 pSettings->ButtonResponsiveness[0] = pStandard->ButtonResponsiveness[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 pSettings->ButtonResponsiveness[1] = pStandard->ButtonResponsiveness[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392 pSettings->ButtonResponsiveness[2] = pStandard->ButtonResponsiveness[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 pSettings->ButtonResponsiveness[3] = pStandard->ButtonResponsiveness[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 pSettings->timeoutSurfacemode = pStandard->timeoutSurfacemode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 pSettings->timeoutMenuSurface = pStandard->timeoutMenuSurface;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 pSettings->timeoutMenuDive = pStandard->timeoutMenuDive;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 pSettings->timeoutMenuEdit = pStandard->timeoutMenuEdit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 pSettings->timeoutInfo = pStandard->timeoutInfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 pSettings->timeoutInfoCompass = pStandard->timeoutInfoCompass;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 pSettings->timeoutDiveReachedZeroDepth = pStandard->timeoutDiveReachedZeroDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 pSettings->divetimeToCreateLogbook = pStandard->divetimeToCreateLogbook;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 pSettings->safetystopDuration = pStandard->safetystopDuration; // change from on/off to minutes
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 // no break
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 case 0xFFFF0007:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 case 0xFFFF0008:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 pSettings->alwaysShowPPO2 = pStandard->alwaysShowPPO2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 pSettings->logbookOffset = pStandard->logbookOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 // no break
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 case 0xFFFF0009:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 pSettings->extraDisplay = pStandard->extraDisplay;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 // no break
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 case 0xFFFF000A:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 pSettings->display_toogle_desc = pStandard->display_toogle_desc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 // no break
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 case 0xFFFF000B:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 pSettings->offsetPressure_mbar = pStandard->offsetPressure_mbar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 pSettings->offsetTemperature_centigrad = pStandard->offsetTemperature_centigrad;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 pSettings->gasConsumption_travel_l_min = pStandard->gasConsumption_travel_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 pSettings->gasConsumption_bottom_l_min = pStandard->gasConsumption_bottom_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 pSettings->gasConsumption_deco_l_min = pStandard->gasConsumption_deco_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 // no break
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 case 0xFFFF000C:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 memcpy(pSettings->customtext, " hwOS 4\n\r" " welcome\n\r", 60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 // no break
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 case 0xFFFF000D: // nothing to do from 0xFFFF000D to 0xFFFF000E, just about header :-)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 case 0xFFFF000E:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 pSettings->debugModeOnStart = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 // no break
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 case 0xFFFF000F:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 pSettings->compassBearing = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 // no break
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 case 0xFFFF0011:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 pSettings->lastKnownBatteryPercentage = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 // no break
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 case 0xFFFF0012:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436 pSettings->buttonBalance[0] = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 pSettings->buttonBalance[1] = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 pSettings->buttonBalance[2] = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 // no break
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 case 0xFFFF0013:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 case 0xFFFF0014:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 pSettings->timeoutSurfacemodeWithSensors = pStandard->timeoutSurfacemodeWithSensors;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 // no break
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 case 0xFFFF0015:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 pSettings->ButtonResponsiveness[3] = pStandard->ButtonResponsiveness[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 settingsHelperButtonSens_keepPercentageValues(settingsHelperButtonSens_translate_hwOS_values_to_percentage(pSettings->ButtonResponsiveness[3]), pSettings->ButtonResponsiveness);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 pSettings->VPM_model = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 pSettings->GF_model = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 // no break
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 case 0xFFFF0016:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 pSettings->FactoryButtonBase = pStandard->FactoryButtonBase;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 pSettings->FactoryButtonBalance[0] = pStandard->FactoryButtonBalance[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 pSettings->FactoryButtonBalance[1] = pStandard->FactoryButtonBalance[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 pSettings->FactoryButtonBalance[2] = pStandard->FactoryButtonBalance[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 // no break
111
38785aa95837 Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents: 75
diff changeset
456 case 0xFFFF0017:
38785aa95837 Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents: 75
diff changeset
457 pSettings->FlipDisplay = 0;
38785aa95837 Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents: 75
diff changeset
458 // no break
210
b2a9e9b02df0 New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents: 172
diff changeset
459 case 0xFFFF0018:
b2a9e9b02df0 New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents: 172
diff changeset
460 pSettings->cv_configuration = 0xFFFFFFFF;
b2a9e9b02df0 New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents: 172
diff changeset
461 // 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
462 case 0xFFFF0019:
375
4bb5ceebfaf9 Use Enum values for initialization and setting check:
ideenmodellierer
parents: 372
diff changeset
463 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
464 // no break
498
4811f3dfaa52 Added dew parameter to enable selection of customer BigFont screens to be displayed
Ideenmodellierer
parents: 492
diff changeset
465 case 0xFFFF001A:
505
06b21f1e47a5 Removed second big font profile
Ideenmodellierer
parents: 498
diff changeset
466 /* 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
467 pSettings->cv_config_BigScreen = 0xFFFFFFFF;
505
06b21f1e47a5 Removed second big font profile
Ideenmodellierer
parents: 498
diff changeset
468 pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << CVIEW_T3_Navigation;
06b21f1e47a5 Removed second big font profile
Ideenmodellierer
parents: 498
diff changeset
469 pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << CVIEW_T3_DepthData;
498
4811f3dfaa52 Added dew parameter to enable selection of customer BigFont screens to be displayed
Ideenmodellierer
parents: 492
diff changeset
470 // no break
539
d784f281833a Added inertia simulation for compass heading:
Ideenmodellierer
parents: 533
diff changeset
471 case 0xFFFF001B:
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 539
diff changeset
472 pSettings->compassInertia = 0; /* no inertia */
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 539
diff changeset
473 pSettings->tX_customViewPrimaryBF = CVIEW_T3_Decostop;
542
6960df7ddb09 Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents: 541
diff changeset
474 pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << CVIEW_T3_DecoTTS;
539
d784f281833a Added inertia simulation for compass heading:
Ideenmodellierer
parents: 533
diff changeset
475 // no break
546
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
476 case 0xFFFF001C:
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
477 pSettings->viewPortMode = 0;
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
478 pSettings->viewRoll = 0;
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
479 pSettings->viewPitch = 0;
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
480 pSettings->viewYaw = 0;
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
481 // no break
560
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
482 case 0xFFFF001D:
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
483 pSettings->ppo2sensors_source = O2_SENSOR_SOURCE_OPTIC;
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
484 pSettings->ppo2sensors_calibCoeff[0] = 0.0;
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
485 pSettings->ppo2sensors_calibCoeff[1] = 0.0;
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
486 pSettings->ppo2sensors_calibCoeff[2] = 0.0;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
487 pSettings->amPMTime = 0;
560
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
488 // no break
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
489 case 0xFFFF001E:
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
490 pSettings->autoSetpoint = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
491 pSettings->scrubTimerMax = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
492 pSettings->scrubTimerCur = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
493 pSettings->scrubTimerMode = SCRUB_TIMER_OFF;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
494 // no break
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
495 case 0xFFFF001F:
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
496 pSettings->pscr_lung_ratio = 10;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
497 pSettings->pscr_o2_drop = 4;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
498 // no break
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
499 case 0xFFFF0020:
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
500 pSettings->co2_sensor_active = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
501 // no break;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 default:
210
b2a9e9b02df0 New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents: 172
diff changeset
503 pSettings->header = pStandard->header;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 break; // no break before!!
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 uint8_t newFirmwareVersionCheckViaSettings(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 SSettings* pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513 if(pSettings->header < 0xFFFF0014) // for the versions without firmwareVersion[]
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 return 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 if(pSettings->firmwareVersion[0] != firmware_FirmwareData.versionFirst)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 return 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518 if(pSettings->firmwareVersion[1] != firmware_FirmwareData.versionSecond)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 return 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 if(pSettings->firmwareVersion[2] != firmware_FirmwareData.versionThird)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 return 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 if(pSettings->firmwareVersion[3] != firmware_FirmwareData.versionBeta)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 return 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 return 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 void set_settings_button_to_standard_with_individual_buttonBalance(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 settingsHelperButtonSens_keepPercentageValues(SettingsStandard.ButtonResponsiveness[3], settingsGetPointer()->ButtonResponsiveness);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 uint8_t check_and_correct_settings(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 uint32_t corrections = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 uint8_t firstGasFoundOC = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 uint8_t firstGasFoundCCR = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
541
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
542 settingsWarning = 0; /* reset warning indicator */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
543
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 /* uint32_t header;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 /* uint8_t warning_blink_dsec; 1/10 seconds
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 if((Settings.warning_blink_dsec < 1) || (Settings.warning_blink_dsec > 100))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 Settings.warning_blink_dsec = SettingsStandard.warning_blink_dsec;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 /* uint8_t lastDiveLogId;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 /* uint32_t logFlashNextSampleStartAddress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 if((Settings.logFlashNextSampleStartAddress < SAMPLESTART) || (Settings.logFlashNextSampleStartAddress > SAMPLESTOP))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 Settings.logFlashNextSampleStartAddress = SAMPLESTART;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 /* uint8_t dive_mode; has to before the gases
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 if( (Settings.dive_mode != DIVEMODE_OC) &&
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 (Settings.dive_mode != DIVEMODE_CCR) &&
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 (Settings.dive_mode != DIVEMODE_Gauge) &&
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
572 (Settings.dive_mode != DIVEMODE_Apnea) &&
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
573 (Settings.dive_mode != DIVEMODE_PSCR))
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 Settings.dive_mode = DIVEMODE_OC;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 /* SGasLine gas[1 + (2*NUM_GASES)];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 for(int i=1; i<=2*NUM_GASES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 if(Settings.gas[i].oxygen_percentage < 4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 Settings.gas[i].oxygen_percentage = 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 if(Settings.gas[i].oxygen_percentage > 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 Settings.gas[i].oxygen_percentage = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594 if((Settings.gas[i].oxygen_percentage + Settings.gas[i].helium_percentage) > 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 Settings.gas[i].helium_percentage = 100 - Settings.gas[i].oxygen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 if(Settings.gas[i].note.ub.deco)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 if(Settings.gas[i].note.ub.active != 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603 Settings.gas[i].note.ub.active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606 if(Settings.gas[i].note.ub.travel == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 Settings.gas[i].note.ub.travel = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 if(Settings.gas[i].note.ub.travel)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614 if(Settings.gas[i].note.ub.active != 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616 Settings.gas[i].note.ub.active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 if(Settings.gas[i].note.ub.deco == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 Settings.gas[i].note.ub.deco = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 if(Settings.gas[i].note.ub.first)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 {
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
627 if(Settings.gas[i].note.ub.active != 1)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628 {
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
629 Settings.gas[i].note.ub.active = 1;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 if(Settings.gas[i].note.ub.travel == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 Settings.gas[i].note.ub.travel = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637 if(Settings.gas[i].note.ub.deco == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 Settings.gas[i].note.ub.deco = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 if((i<=NUM_GASES) && (!firstGasFoundOC))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 firstGasFoundOC = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 if((i>NUM_GASES) && (!firstGasFoundCCR))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 firstGasFoundCCR = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648 Settings.gas[i].note.ub.first = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 if(Settings.gas[i].bottle_size_liter > 40)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 Settings.gas[i].bottle_size_liter = 40;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655 if(Settings.gas[i].depth_meter > 250)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 Settings.gas[i].depth_meter = 250;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 if(Settings.gas[i].depth_meter_travel > 250)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662 Settings.gas[i].depth_meter_travel = 250;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 /*if(Settings.gas[i].note.ub.senderCode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 if(Settings.gas[i].bottle_wireless_id)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 } // for(int i=1; i<=2*NUM_GASES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 if(!firstGasFoundOC)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676 Settings.gas[1].note.ub.active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 Settings.gas[1].note.ub.first = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678 Settings.gas[1].note.ub.travel = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 Settings.gas[1].note.ub.deco = 0;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
680 corrections++;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 if(!firstGasFoundCCR)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 Settings.gas[1 + NUM_GASES].note.ub.active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685 Settings.gas[1 + NUM_GASES].note.ub.first = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686 Settings.gas[1 + NUM_GASES].note.ub.travel = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687 Settings.gas[1 + NUM_GASES].note.ub.deco = 0;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
688 corrections++;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 /* SSetpointLine setpoint[1 + NUM_GASES];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692 for(int i=1; i<=NUM_GASES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 {
652
f6212495f34f Allow setpoint starting at 0.4 ppO2:
Ideenmodellierer
parents: 650
diff changeset
694 if(Settings.setpoint[i].setpoint_cbar < MIN_PPO2_SP_CBAR)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 {
652
f6212495f34f Allow setpoint starting at 0.4 ppO2:
Ideenmodellierer
parents: 650
diff changeset
696 Settings.setpoint[i].setpoint_cbar = MIN_PPO2_SP_CBAR;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699 if(Settings.setpoint[i].setpoint_cbar > 160)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 Settings.setpoint[i].setpoint_cbar = 160;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 if(Settings.setpoint[i].depth_meter > 250)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706 Settings.setpoint[i].depth_meter = 250;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 if(Settings.setpoint[i].note.ub.deco)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711 if(Settings.setpoint[i].note.ub.active != 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 Settings.setpoint[i].note.ub.active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 if(Settings.setpoint[i].note.ub.travel == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 Settings.setpoint[i].note.ub.travel = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 if(Settings.setpoint[i].note.ub.travel)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 if(Settings.setpoint[i].note.ub.active != 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 Settings.setpoint[i].note.ub.active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 if(Settings.setpoint[i].note.ub.deco == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 Settings.setpoint[i].note.ub.deco = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 if(Settings.setpoint[i].note.ub.first)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 if(Settings.setpoint[i].note.ub.active != 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 Settings.setpoint[i].note.ub.active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 if(Settings.setpoint[i].note.ub.travel == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 Settings.setpoint[i].note.ub.travel = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 if(Settings.setpoint[i].note.ub.deco == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 Settings.setpoint[i].note.ub.deco = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 } // for(int i=1; i<=NUM_GASES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 /* uint8_t CCR_Mode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757 if( (Settings.CCR_Mode != CCRMODE_Sensors) &&
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
758 (Settings.CCR_Mode != CCRMODE_Simulation) &&
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 (Settings.CCR_Mode != CCRMODE_FixedSetpoint))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 Settings.CCR_Mode = CCRMODE_FixedSetpoint;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765 /* split2x4_Type deco_type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 if( (Settings.deco_type.ub.standard != GF_MODE) &&
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 (Settings.deco_type.ub.standard != VPM_MODE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 Settings.deco_type.ub.standard = VPM_MODE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773 if(Settings.deco_type.ub.alternative != GF_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
774 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775 Settings.deco_type.ub.alternative = GF_MODE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
777 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779 /* uint8_t ppO2_max_deco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781 if(Settings.ppO2_max_deco > 190)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783 Settings.ppO2_max_deco = 190;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786 if(Settings.ppO2_max_deco < 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788 Settings.ppO2_max_deco = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792 /* uint8_t ppO2_max_std;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
793 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
794 if(Settings.ppO2_max_std > 190)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
795 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
796 Settings.ppO2_max_std = 190;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
797 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
798 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 if(Settings.ppO2_max_std < 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
800 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
801 Settings.ppO2_max_std = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805 /* uint8_t ppO2_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807 if(Settings.ppO2_min != 15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809 Settings.ppO2_min = 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813 /* uint8_t CNS_max;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 if(Settings.CNS_max != 90)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817 Settings.CNS_max = 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
818 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
819 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
820
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
821 /* uint8_t ascent_MeterPerMinute_max;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
822 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
823 if(Settings.ascent_MeterPerMinute_max != 30)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
824 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
825 Settings.ascent_MeterPerMinute_max = 30;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
826 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
827 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
828
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
829 /* uint8_t ascent_MeterPerMinute_showGraph;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
830 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
831 if(Settings.ascent_MeterPerMinute_showGraph != 30)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
832 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
833 Settings.ascent_MeterPerMinute_showGraph = 30;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
834 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
835 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
836
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
837 /* uint8_t future_TTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
838 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
839 if(Settings.future_TTS > 15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
840 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
841 Settings.future_TTS = 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
842 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
843 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
844
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
845 /* uint8_t GF_high;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
846 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
847 if(Settings.GF_high > 99)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
848 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
849 Settings.GF_high = 99;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
850 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
851 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
852 if(Settings.GF_high < 45)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
853 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
854 Settings.GF_high = 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
855 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
856 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
857
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
858 /* uint8_t GF_low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
860 if(Settings.GF_low > 99)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
861 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
862 Settings.GF_low = 99;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
863 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
864 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
865 if(Settings.GF_low < 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
866 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
867 Settings.GF_low = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
868 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
869 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
870 if(Settings.GF_low > Settings.GF_high)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
871 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
872 Settings.GF_low = Settings.GF_high;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
873 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
874 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
875
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
876 /* uint8_t aGF_high;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
877 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
878 if(Settings.aGF_high > 99)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
879 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
880 Settings.aGF_high = 99;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
881 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
882 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
883 if(Settings.aGF_high < 45)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
884 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
885 Settings.aGF_high = 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
886 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
887 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
888
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
889 /* uint8_t aGF_low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
890 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
891 if(Settings.aGF_low > 99)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
892 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
893 Settings.aGF_low = 99;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
894 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
895 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
896 if(Settings.aGF_low < 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
897 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
898 Settings.aGF_low = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
899 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
900 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
901 if(Settings.aGF_low > Settings.aGF_high)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
902 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
903 Settings.aGF_low = Settings.aGF_high;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
904 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
905 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
906
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
907 /* split2x4_Type VPM_conservatism;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
908 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
909 if(Settings.VPM_conservatism.ub.standard > 5)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
910 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
911 Settings.VPM_conservatism.ub.standard = 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
912 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
913 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
914 if(Settings.VPM_conservatism.ub.alternative > 5)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
915 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
916 Settings.VPM_conservatism.ub.alternative = 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
917 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
918 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
919
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
920 /* uint8_t safetystopDuration;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
921 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
922 if(Settings.safetystopDuration > 5)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
923 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
924 Settings.safetystopDuration = 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
925 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
926 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
927
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
928 /* uint8_t AtemMinutenVolumenLiter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
929 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
930 if(Settings.AtemMinutenVolumenLiter != 25)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
931 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
932 Settings.AtemMinutenVolumenLiter = 25;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
933 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
934 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
935
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
936 /* uint8_t ReserveFractionDenominator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
937 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
938 if(Settings.ReserveFractionDenominator != 4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
939 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
940 Settings.ReserveFractionDenominator = 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
941 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
942 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
943
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
944 /* uint8_t salinity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
945 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
946 if(Settings.salinity > 4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
947 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
948 Settings.salinity = 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
949 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
950 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
951
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
952 /* uint8_t last_stop_depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
953 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
954 if(Settings.last_stop_depth_meter > 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
955 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
956 Settings.last_stop_depth_meter = 9;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
957 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
958 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
959 if(Settings.last_stop_depth_meter < 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
960 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
961 Settings.last_stop_depth_meter = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
962 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
963 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
964
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
965 /* uint8_t stop_increment_depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
966 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
967 if(Settings.stop_increment_depth_meter != 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
968 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
969 Settings.stop_increment_depth_meter = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
970 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
971 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
972
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
973 /* uint8_t brightness;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
974 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
975 if(Settings.brightness > 4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
976 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
977 Settings.brightness = 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
978 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
979 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
980
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
981 /* uint8_t date_format;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
982 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
983 if( (Settings.date_format != DDMMYY) &&
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
984 (Settings.date_format != MMDDYY) &&
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
985 (Settings.date_format != YYMMDD))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
986 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
987 Settings.date_format = DDMMYY;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
988 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
989 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
990
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
991 /* uint8_t selected_language;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
992 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
993 if(Settings.selected_language >= LANGUAGE_END)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
994 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
995 Settings.selected_language = LANGUAGE_English;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
996 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
997 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
998
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
999 /* char customtext[60];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1000 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1001 if(Settings.customtext[59] != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1002 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1003 Settings.customtext[59] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1004 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1005 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1006
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1007 /* uint16_t timeoutSurfacemode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1008 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1009 if( (Settings.timeoutSurfacemode != 20) && // Quick Sleep Option
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1010 (Settings.timeoutSurfacemode != 120))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1011 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1012 Settings.timeoutSurfacemode = 120;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1013 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1014 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1015
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1016 /* uint8_t timeoutMenuSurface;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1017 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1018 if(Settings.timeoutMenuSurface != 120)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1019 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1020 Settings.timeoutMenuSurface = 120;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1021 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1022 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1023
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1024 /* uint8_t timeoutMenuDive;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1025 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1026 if(Settings.timeoutMenuDive != 120)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1027 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1028 Settings.timeoutMenuDive = 120;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1029 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1030 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1031
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1032 /* uint8_t timeoutMenuEdit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1033 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1034 if(Settings.timeoutMenuEdit != 120)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1035 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1036 Settings.timeoutMenuEdit = 120;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1037 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1038 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1039
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1040 /* uint8_t timeoutInfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1041 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1042 if(Settings.timeoutInfo != 120)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1043 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1044 Settings.timeoutInfo = 120;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1045 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1046 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1047
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1048 /* uint8_t timeoutInfoCompass;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1049 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1050 if(Settings.timeoutInfoCompass != 60)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1051 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1052 Settings.timeoutInfoCompass = 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1053 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1054 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1055
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1056 /* uint8_t design;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1057 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1058 if(Settings.design != 7)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1059 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1060 Settings.design = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1061 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1062 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1063
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1064 /* uint16_t timeoutDiveReachedZeroDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1065 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1066 if(Settings.timeoutDiveReachedZeroDepth != 300)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1067 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1068 Settings.timeoutDiveReachedZeroDepth = 300;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1069 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1070 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1071
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1072 /* uint16_t divetimeToCreateLogbook;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1073 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1074 if(Settings.divetimeToCreateLogbook != 60)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1075 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1076 Settings.divetimeToCreateLogbook = 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1077 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1078 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1079
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1080 /* uint8_t serialHigh;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1081 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1082
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1083 /* uint8_t serialLow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1084 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1085
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1086 /* SUFirmware firmwareVersion16to32bit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1087 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1088
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1089 /* uint32_t backup_localtime_rtc_tr;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1090 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1091
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1092 /* uint32_t backup_localtime_rtc_dr;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1093 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1094
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1095 /* uint16_t totalDiveCounter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1096 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1097
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1098 /* uint16_t personalDiveCount;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1099 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1100
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1101 /* uint8_t showDebugInfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1102 */
492
4ce932235578 Added compiler switch for existing debug view parameter
Ideenmodellierer
parents: 488
diff changeset
1103
4ce932235578 Added compiler switch for existing debug view parameter
Ideenmodellierer
parents: 488
diff changeset
1104 #ifdef HAVE_DEBUG_VIEW
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1105 if(Settings.showDebugInfo > 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1106 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1107 Settings.showDebugInfo = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1108 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1109 }
492
4ce932235578 Added compiler switch for existing debug view parameter
Ideenmodellierer
parents: 488
diff changeset
1110 #else
4ce932235578 Added compiler switch for existing debug view parameter
Ideenmodellierer
parents: 488
diff changeset
1111 Settings.showDebugInfo = 0;
4ce932235578 Added compiler switch for existing debug view parameter
Ideenmodellierer
parents: 488
diff changeset
1112 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1113
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1114 /* uint8_t ButtonResponsiveness[4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1115 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1116 // Base value, index 3
93
3d6ccfb0190b a bit of
Dmitry Romanov <kitt@bk.ru>
parents: 92
diff changeset
1117 if(Settings.ButtonResponsiveness[3] < MIN_BUTTONRESPONSIVENESS_GUI)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1118 {
93
3d6ccfb0190b a bit of
Dmitry Romanov <kitt@bk.ru>
parents: 92
diff changeset
1119 Settings.ButtonResponsiveness[3] = MIN_BUTTONRESPONSIVENESS_GUI;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1120 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1121 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1122 else
151
a98f91cca107 Bugfix ButtonResponsiveness
Ideenmodellierer
parents: 146
diff changeset
1123 if(Settings.ButtonResponsiveness[3] > MAX_BUTTONRESPONSIVENESS_GUI)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1124 {
151
a98f91cca107 Bugfix ButtonResponsiveness
Ideenmodellierer
parents: 146
diff changeset
1125 Settings.ButtonResponsiveness[3] = MAX_BUTTONRESPONSIVENESS_GUI;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1126 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1127 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1128 // flex values 0, 1, 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1129 for(int i=0; i<3;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1130 {
93
3d6ccfb0190b a bit of
Dmitry Romanov <kitt@bk.ru>
parents: 92
diff changeset
1131 if(Settings.ButtonResponsiveness[i] < MIN_BUTTONRESPONSIVENESS) // 50-10 //Fix for broken buttons. :)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1132 {
93
3d6ccfb0190b a bit of
Dmitry Romanov <kitt@bk.ru>
parents: 92
diff changeset
1133 Settings.ButtonResponsiveness[i] = MIN_BUTTONRESPONSIVENESS;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1134 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1135 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1136 else
93
3d6ccfb0190b a bit of
Dmitry Romanov <kitt@bk.ru>
parents: 92
diff changeset
1137 if(Settings.ButtonResponsiveness[i] > MAX_BUTTONRESPONSIVENESS) // 110+20
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1138 {
93
3d6ccfb0190b a bit of
Dmitry Romanov <kitt@bk.ru>
parents: 92
diff changeset
1139 Settings.ButtonResponsiveness[i] = MAX_BUTTONRESPONSIVENESS;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1140 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1141 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1142 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1143
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1144 /* uint8_t buttonBalance[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1145 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1146 for(int i=0; i<3;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1147 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1148 if(Settings.buttonBalance[i] < 2) // 2 = -10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1149 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1150 Settings.buttonBalance[i] = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1151 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1152 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1153 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1154 if(Settings.buttonBalance[i] > 5) // 3 = 0, 4 = +10, 5 = +20
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1155 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1156 Settings.buttonBalance[i] = 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1157 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1158 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1159 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1160
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1161 /* uint8_t nonMetricalSystem;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1162 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1163 if(Settings.nonMetricalSystem > 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1164 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1165 Settings.nonMetricalSystem = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1166 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1167 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1168
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1169 /* uint8_t fallbackToFixedSetpoint;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1170 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1171 if(Settings.fallbackToFixedSetpoint > 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1172 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1173 Settings.fallbackToFixedSetpoint = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1174 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1175 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1176
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1177 /* uint8_t bluetoothActive;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1178 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1179 if(Settings.bluetoothActive > 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1180 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1181 Settings.bluetoothActive = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1182 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1183 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1184
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1185 /* uint8_t safetystopDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1186 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1187 if(Settings.safetystopDepth > 6)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1188 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1189 Settings.safetystopDepth = 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1190 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1191 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1192 if(Settings.safetystopDepth < 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1193 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1194 Settings.safetystopDepth = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1195 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1196 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1197
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1198 /* uint32_t updateSettingsAllowedFromHeader;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1199 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1200
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1201 /* uint8_t ppo2sensors_deactivated;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1202 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1203 if(Settings.ppo2sensors_deactivated > (1+2+4))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1204 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1205 Settings.ppo2sensors_deactivated = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1206 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1207 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1208
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1209 /* uint8_t tX_colorscheme;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1210 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1211 if(Settings.tX_colorscheme > 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1212 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1213 Settings.tX_colorscheme = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1214 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1215 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1216
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1217 /* uint8_t tX_userselectedLeftLowerCornerPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1218 */
443
a5101c688b49 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 439
diff changeset
1219 if(Settings.tX_userselectedLeftLowerCornerPrimary >= LLC_END)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1220 {
443
a5101c688b49 Introduced enum for lower left corner view selection:
ideenmodellierer
parents: 439
diff changeset
1221 Settings.tX_userselectedLeftLowerCornerPrimary = LLC_Temperature;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1222 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1223 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1224
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1225 /* uint8_t tX_userselectedLeftLowerCornerTimeout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1226 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1227 if(Settings.tX_userselectedLeftLowerCornerTimeout > 60)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1228 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1229 Settings.tX_userselectedLeftLowerCornerTimeout = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1230 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1231 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1232
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1233 /* uint8_t tX_customViewPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1234 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1235 if(Settings.tX_customViewPrimary >= CVIEW_END)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1236 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1237 Settings.tX_customViewPrimary = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1238 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1239 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1240
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1241 /* uint8_t tX_customViewTimeout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1242 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1243 if(Settings.tX_customViewTimeout > 60)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1244 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1245 Settings.tX_customViewTimeout = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1246 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1247 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1248
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1249 /* uint8_t timeoutEnterButtonSelectDive;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1250 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1251 if(Settings.timeoutEnterButtonSelectDive != 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1252 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1253 Settings.timeoutEnterButtonSelectDive = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1254 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1255 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1256
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1257 /* uint8_t logbookOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1258 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1259 if(Settings.logbookOffset > 9000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1260 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1261 Settings.logbookOffset = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1262 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1263 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1264
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1265 /* uint8_t alwaysShowPPO2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1266 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1267 if(Settings.alwaysShowPPO2 > 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1268 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1269 Settings.alwaysShowPPO2 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1270 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1271 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1272
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1273 /* uint8_t extraDisplay;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1274 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1275 if(Settings.extraDisplay >= EXTRADISPLAY_END)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1276 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1277 Settings.extraDisplay = EXTRADISPLAY_BIGFONT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1278 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1279 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1280
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1281 /* int8_t offsetPressure_mbar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1282 */
337
38367bb982b8 Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents: 334
diff changeset
1283 if((Settings.offsetPressure_mbar > PRESSURE_OFFSET_LIMIT_MBAR) ||
38367bb982b8 Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents: 334
diff changeset
1284 (Settings.offsetPressure_mbar < -1 * PRESSURE_OFFSET_LIMIT_MBAR))
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1285 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1286 Settings.offsetPressure_mbar = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1287 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1288 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1289
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1290 /* int8_t offsetTemperature_centigrad;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1291 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1292 if((Settings.offsetTemperature_centigrad > 20) ||
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1293 (Settings.offsetTemperature_centigrad < -20))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1294 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1295 Settings.offsetTemperature_centigrad = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1296 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1297 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1298
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1299 /* uint8_t gasConsumption_travel_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1300 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1301 if((Settings.gasConsumption_travel_l_min < 5) ||
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1302 (Settings.gasConsumption_travel_l_min > 50))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1303 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1304 Settings.gasConsumption_travel_l_min = 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1305 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1306 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1307
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1308 /* uint8_t gasConsumption_bottom_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1309 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1310 if((Settings.gasConsumption_bottom_l_min < 5) ||
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1311 (Settings.gasConsumption_bottom_l_min > 50))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1312 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1313 Settings.gasConsumption_bottom_l_min = 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1314 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1315 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1316
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1317 /* uint8_t gasConsumption_deco_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1318 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1319 if((Settings.gasConsumption_deco_l_min < 5) ||
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1320 (Settings.gasConsumption_deco_l_min > 50))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1321 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1322 Settings.gasConsumption_deco_l_min = 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1323 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1324 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1325
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1326 /* uint8_t showDebugInfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1327 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1328 #ifdef BOOT16
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1329 Settings.showDebugInfo = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1330 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1331 if(Settings.showDebugInfo > 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1332 Settings.showDebugInfo = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1333
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1334 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1335
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1336 /* uint8_t selected_language;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1337 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1338 #ifdef BOOT16
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1339 if(Settings.selected_language > 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1340 Settings.selected_language = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1341 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1342 if(Settings.selected_language > 4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1343 Settings.selected_language = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1344 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1345
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1346
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1347 /* uint8_t display_toogle_desc; 1/10 seconds
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1348 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1349 if((Settings.display_toogle_desc < 20) || (Settings.display_toogle_desc > 600))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1350 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1351 Settings.display_toogle_desc = SettingsStandard.display_toogle_desc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1352 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1353 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1354
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1355 /* uint8_t debugModeOnStart;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1356 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1357 if(Settings.debugModeOnStart > 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1358 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1359 Settings.debugModeOnStart = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1360 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1361 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1362
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1363
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1364 /* uint8_t IAmStolenPleaseKillMe;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1365 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1366
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1367 if(hardwareDataGetPointer()->primarySerial == 90)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1368 Settings.IAmStolenPleaseKillMe++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1369 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1370 Settings.IAmStolenPleaseKillMe = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1371
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1372
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1373 /* uint8_t debugModeOnStart;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1374 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1375 if(Settings.compassBearing > 360)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1376 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1377 Settings.compassBearing = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1378 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1379 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1380
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1381
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1382 /* uint8_t lastKnownBatteryPercentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1383 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1384 if(Settings.lastKnownBatteryPercentage > 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1385 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1386 Settings.lastKnownBatteryPercentage = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1387 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1388 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1389
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1390 /* uint8_t VPM_model
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1391 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1392 if((Settings.VPM_model != VPM_FROM_FORTRAN) && (Settings.VPM_model != VPM_BACHELORWORK))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1393 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1394 Settings.VPM_model = VPM_FROM_FORTRAN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1395 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1396 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1397
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1398 /* uint8_t Buehlmann_model
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1399 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1400 if((Settings.GF_model != BUEHLMANN_OSTC4) && (Settings.GF_model != BUEHLMANN_hwOS))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1401 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1402 Settings.GF_model = BUEHLMANN_OSTC4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1403 corrections++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1404 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1405
111
38785aa95837 Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents: 75
diff changeset
1406 if(Settings.FlipDisplay > 1) /* only boolean values allowed */
38785aa95837 Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents: 75
diff changeset
1407 {
38785aa95837 Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents: 75
diff changeset
1408 Settings.FlipDisplay = 0;
38785aa95837 Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents: 75
diff changeset
1409 corrections++;
38785aa95837 Added new nvm parameter"FlipDisplay" indicating the screen orientation
Ideenmodellierer
parents: 75
diff changeset
1410 }
522
7512804bc6cf Added compile switch for motion control:
Ideenmodellierer
parents: 505
diff changeset
1411
7512804bc6cf Added compile switch for motion control:
Ideenmodellierer
parents: 505
diff changeset
1412 #ifdef ENABLE_MOTION_CONTROL
375
4bb5ceebfaf9 Use Enum values for initialization and setting check:
ideenmodellierer
parents: 372
diff changeset
1413 if(Settings.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
1414 {
375
4bb5ceebfaf9 Use Enum values for initialization and setting check:
ideenmodellierer
parents: 372
diff changeset
1415 Settings.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
1416 corrections++;
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
1417 }
522
7512804bc6cf Added compile switch for motion control:
Ideenmodellierer
parents: 505
diff changeset
1418 #else
7512804bc6cf Added compile switch for motion control:
Ideenmodellierer
parents: 505
diff changeset
1419 Settings.MotionDetection = MOTION_DETECT_OFF;
550
af1c3e3abd5f Make sure motion detection settings are set to default values:
Ideenmodellierer
parents: 546
diff changeset
1420 Settings.viewPortMode = 0;
af1c3e3abd5f Make sure motion detection settings are set to default values:
Ideenmodellierer
parents: 546
diff changeset
1421 Settings.viewRoll = 0.0;
af1c3e3abd5f Make sure motion detection settings are set to default values:
Ideenmodellierer
parents: 546
diff changeset
1422 Settings.viewPitch = 0.0;
af1c3e3abd5f Make sure motion detection settings are set to default values:
Ideenmodellierer
parents: 546
diff changeset
1423 Settings.viewYaw = 0.0;
522
7512804bc6cf Added compile switch for motion control:
Ideenmodellierer
parents: 505
diff changeset
1424 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1425
539
d784f281833a Added inertia simulation for compass heading:
Ideenmodellierer
parents: 533
diff changeset
1426 if(Settings.compassInertia > MAX_COMPASS_COMP)
d784f281833a Added inertia simulation for compass heading:
Ideenmodellierer
parents: 533
diff changeset
1427 {
d784f281833a Added inertia simulation for compass heading:
Ideenmodellierer
parents: 533
diff changeset
1428 Settings.compassInertia = 0;
d784f281833a Added inertia simulation for compass heading:
Ideenmodellierer
parents: 533
diff changeset
1429 corrections++;
d784f281833a Added inertia simulation for compass heading:
Ideenmodellierer
parents: 533
diff changeset
1430 }
541
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 539
diff changeset
1431 if(Settings.tX_customViewPrimaryBF > CVIEW_T3_END)
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 539
diff changeset
1432 {
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 539
diff changeset
1433 Settings.tX_customViewPrimaryBF = CVIEW_T3_Decostop;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 539
diff changeset
1434 corrections++;
6fbf7cd391cb Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents: 539
diff changeset
1435 }
546
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
1436 if(Settings.viewPortMode > MAX_VIEWPORT_MODE)
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
1437 {
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
1438 Settings.viewPortMode = 0;
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
1439 corrections++;
daa8d4474ba0 Added new settings for Viewport:
Ideenmodellierer
parents: 542
diff changeset
1440 }
560
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
1441 if(Settings.ppo2sensors_source >= O2_SENSOR_SOURCE_MAX)
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
1442 {
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
1443 Settings.ppo2sensors_source = O2_SENSOR_SOURCE_OPTIC;
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
1444 Settings.ppo2sensors_calibCoeff[0] = 0.0;
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
1445 Settings.ppo2sensors_calibCoeff[1] = 0.0;
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
1446 Settings.ppo2sensors_calibCoeff[2] = 0.0;
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
1447 corrections++;
5d80bb8d22cb Added O2 sensor source and calibration parameters to setting structure
Ideenmodellierer
parents: 550
diff changeset
1448 }
539
d784f281833a Added inertia simulation for compass heading:
Ideenmodellierer
parents: 533
diff changeset
1449
567
1c95f811967c -Add 12HR Time Support
izzni
parents: 560
diff changeset
1450 if(Settings.amPMTime > 1) /* only boolean values allowed */
1c95f811967c -Add 12HR Time Support
izzni
parents: 560
diff changeset
1451 {
1c95f811967c -Add 12HR Time Support
izzni
parents: 560
diff changeset
1452 Settings.amPMTime = 0;
1c95f811967c -Add 12HR Time Support
izzni
parents: 560
diff changeset
1453 corrections++;
1c95f811967c -Add 12HR Time Support
izzni
parents: 560
diff changeset
1454 }
650
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
1455
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
1456 if(Settings.autoSetpoint > 1) /* only boolean values allowed */
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
1457 {
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
1458 Settings.autoSetpoint = 0;
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
1459 corrections++;
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
1460 }
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
1461
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
1462 if((Settings.scrubTimerMax > MAX_SCRUBBER_TIME) || (Settings.scrubTimerCur > MAX_SCRUBBER_TIME))
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
1463 {
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
1464 Settings.scrubTimerMax = 0;
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
1465 Settings.scrubTimerCur = 0;
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
1466 corrections++;
5f0d3dce5ef4 Automatik setpoint change:
Ideenmodellierer
parents: 644
diff changeset
1467 }
654
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 652
diff changeset
1468 if(Settings.scrubTimerMode > SCRUB_TIMER_END)
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 652
diff changeset
1469 {
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 652
diff changeset
1470 Settings.scrubTimerMode = SCRUB_TIMER_OFF;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 652
diff changeset
1471 corrections++;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 652
diff changeset
1472 }
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1473
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1474 if((Settings.pscr_lung_ratio > PSCR_MAX_LUNG_RATIO) || (Settings.pscr_lung_ratio < PSCR_MIN_LUNG_RATIO))
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1475 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1476 Settings.pscr_lung_ratio = 10;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1477 corrections++;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1478 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1479 if(Settings.pscr_o2_drop > PSCR_MAX_O2_DROP)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1480 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1481 Settings.pscr_o2_drop = 4;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1482 corrections++;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1483 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1484
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1485 if(Settings.co2_sensor_active > 1)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1486 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1487 Settings.co2_sensor_active = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1488 corrections++;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1489 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1490
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1491 if(corrections)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1492 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1493 settingsWarning = 1;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1494 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1495 else
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1496
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1497 if(corrections > 255)
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1498 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1499 corrections = 255;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1500 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1501
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
1502 return (uint8_t)corrections;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1503 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1504
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1505
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1506 /* always at 0x8080000, do not move -> bootloader access */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1507 const SFirmwareData* firmwareDataGetPointer(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1508 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1509 return &firmware_FirmwareData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1510 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1511
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1512
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1513 #ifndef SPECIALPROGRAMM
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1514 const SHardwareData* hardwareDataGetPointer(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1515 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1516 return (SHardwareData *)HARDWAREDATA_ADDRESS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1517 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1518 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1519
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1520 const SSettings* settingsGetPointerStandard(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1521 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1522 return &SettingsStandard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1523 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1524
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1525
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1526 void hardwareBatchCode(uint8_t *high, uint8_t *low)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1527 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1528 if(high)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1529 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1530 *high = (uint8_t)((hardwareDataGetPointer()->production_year - 16) * 16);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1531 *high += hardwareDataGetPointer()->production_month;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1532 if(low)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1533 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1534 *low = (uint8_t)(hardwareDataGetPointer()->production_day * 8);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1535 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1536 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1537 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1538
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1539
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1540 uint8_t firmwareVersion_16bit_high(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1541 {
319
d8e86af78474 bugfix: correct packed main version number in dive header
Jan Mulder <jlmulder@xs4all.nl>
parents: 286
diff changeset
1542 return ((firmware_FirmwareData.versionFirst & 0x1F) << 3) + ((firmware_FirmwareData.versionSecond & 0x1C) >> 2);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1543 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1544
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1545 uint8_t firmwareVersion_16bit_low(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1546 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1547 return ((firmware_FirmwareData.versionSecond & 0x03) << 6) + ((firmware_FirmwareData.versionThird & 0x1F) << 1) + (firmware_FirmwareData.versionBeta & 0x01);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1548 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1549
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
1550 inline SSettings* settingsGetPointer(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1551 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1552 return &Settings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1553 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1554
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1555
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1556 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1557 // set_settings_to_Standard
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1558 /// @brief This function overwrites the current settings of the system
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1559 /// with the EXCEPTION of the personalDiveCount
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1560 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1561 /// It additionally calls set_new_settings_missing_in_ext_flash() and
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1562 /// check_and_correct_settings(), even so this shouldn't be necessary.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1563 /// It is called on every start and from Reset All.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1564 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1565 /// 160622 added lastDiveLogIdBackup
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1566 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1567 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1568 void set_settings_to_Standard(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1569 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1570 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1571 const SSettings *pSettingsStandard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1572 uint16_t personalDiveCountBackup;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1573 uint8_t lastDiveLogIdBackup;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1574 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1575 pSettingsStandard = settingsGetPointerStandard();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1576
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1577 personalDiveCountBackup = pSettings->personalDiveCount;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1578 lastDiveLogIdBackup = pSettings->lastDiveLogId;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1579 memcpy(pSettings,pSettingsStandard,sizeof(*pSettings));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1580 pSettings->personalDiveCount = personalDiveCountBackup;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1581 pSettings->lastDiveLogId = lastDiveLogIdBackup;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1582
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1583 pSettings->firmwareVersion[0] = firmware_FirmwareData.versionFirst;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1584 pSettings->firmwareVersion[1] = firmware_FirmwareData.versionSecond;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1585 pSettings->firmwareVersion[2] = firmware_FirmwareData.versionThird;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1586 pSettings->firmwareVersion[3] = firmware_FirmwareData.versionBeta;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1587
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1588 set_new_settings_missing_in_ext_flash();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1589 check_and_correct_settings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1590 // has to be called too: createDiveSettings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1591 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1592
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1593
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1594 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1595 // mod_settings_for_first_start_with_empty_ext_flash
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1596 /// @brief This function overwrites some settings of the system
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1597 /// It is called on every start.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1598 /// Those settings will be overwriten by ext_flash_read_settings()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1599 /// Will be kept if ext_flash_read_settings() is invalid because
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1600 /// it is still empty.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1601 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1602 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1603 void mod_settings_for_first_start_with_empty_ext_flash(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1604 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1605 settingsGetPointer()->debugModeOnStart = 1; //
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1606 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1607
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1608
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1609
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1610 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1611 // hwOS4_to_hwOS_GasType
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1612 /// @brief Helper for get gas / diluent
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1613 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1614 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1615 uint8_t hwOS4_to_hwOS_GasType(uint8_t inOSTC4style)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1616 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1617 switch(inOSTC4style)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1618 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1619 case (1+2): // first
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1620 case (2): // first
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1621 return 1; // hwOS style first
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1622 case (1+4): // deco
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1623 case (4): // deco
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1624 return 3; // hwOS style deco
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1625 case (1+8): // travel
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1626 case (8): // travel
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1627 return 2; // hwOS style travel
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1628 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1629 return 0; // hwOS style Disabled
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1630 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1631 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1632
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1633
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1634 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1635 // hwOS_to_hwOS4_GasType
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1636 /// @brief Helper for set gas / diluent
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1637 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1638 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1639 uint8_t hwOS_to_hwOS4_GasType(uint8_t inOSTC4style)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1640 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1641 switch(inOSTC4style)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1642 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1643 case (1): // first
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1644 return 1+2; // hwOS4 style first
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1645 case (2): // travel (normal for diluent)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1646 return 1+8; // hwOS4 style travel
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1647 case (3): // deco
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1648 return 1+4; // hwOS4 style deco
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1649 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1650 return 0; // hwOS4 style inactive
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1651 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1652 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1653
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1654
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1655
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1656 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1657 // setGas
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1658 /// @brief This function overwrites one gas, including mode and deco depth,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1659 /// it returns 0x4D prompt which is not used by writeData() that calls it.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1660 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1661 /// @param i the gas id from 1 to 5 for OC and 6 to 10 for CCR, 0 is the extra gas
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1662 /// @param *data 5 bytes with the first the command to call setGas and the four
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1663 /// following bytes to define oxygen, helium, mode and deco depth
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1664 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1665 /// @return 0x4D (prompt that is not used)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1666 // ===============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1667 uint8_t setGas(int i,uint8_t * data)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1668 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1669 if(!checkValue(data[1],4,100))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1670 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1671 if(!checkValue(data[4],0,250))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1672 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1673
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1674 Settings.gas[i].oxygen_percentage = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1675 Settings.gas[i].helium_percentage = data[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1676 Settings.gas[i].note.uw = hwOS_to_hwOS4_GasType(data[3]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1677 Settings.gas[i].depth_meter = data[4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1678 return 0x4d;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1679 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1680
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1681
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1682 uint8_t getGas(int i,uint8_t * data)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1683 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1684 data[0] = Settings.gas[i].oxygen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1685 data[1] = Settings.gas[i].helium_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1686 data[2] = hwOS4_to_hwOS_GasType(Settings.gas[i].note.uw);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1687 data[3] = Settings.gas[i].depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1688 return 0x4d;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1689 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1690
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1691 uint8_t setDiluent(int i,uint8_t * data)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1692 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1693 if(!checkValue(data[1],4,100))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1694 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1695 if(!checkValue(data[4],0,250))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1696 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1697
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1698 Settings.gas[NUM_OFFSET_DILUENT + i].oxygen_percentage = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1699 Settings.gas[NUM_OFFSET_DILUENT + i].helium_percentage = data[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1700 Settings.gas[NUM_OFFSET_DILUENT + i].note.uw = hwOS_to_hwOS4_GasType(data[3]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1701 Settings.gas[NUM_OFFSET_DILUENT + i].depth_meter = data[4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1702 return 0x4d;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1703 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1704
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1705 uint8_t getDiluent(int i,uint8_t * data)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1706 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1707 data[0] = Settings.gas[NUM_OFFSET_DILUENT + i].oxygen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1708 data[1] = Settings.gas[NUM_OFFSET_DILUENT + i].helium_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1709 data[2] = hwOS4_to_hwOS_GasType(Settings.gas[NUM_OFFSET_DILUENT + i].note.uw);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1710 data[3] = Settings.gas[NUM_OFFSET_DILUENT + i].depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1711 return 0x4d;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1712 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1713
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1714 uint8_t setSetpoint(int i,uint8_t * data)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1715 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1716 if(!checkValue(data[1],50,160))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1717 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1718 if(!checkValue(data[2],0,250))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1719 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1720
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1721 Settings.setpoint[i].setpoint_cbar = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1722 Settings.setpoint[i].depth_meter = data[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1723 return 0x4d;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1724 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1725
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1726 uint8_t getSetpoint(int i,uint8_t * data)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1727 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1728 data[0] = Settings.setpoint[i].setpoint_cbar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1729 data[1] = Settings.setpoint[i].depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1730 return 0x4d;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1731 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1732
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1733 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1734 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1735 if(value >= from && value <= to)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1736 return 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1737 return 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1738 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1739
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1740 uint8_t writeData(uint8_t * data)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1741 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1742 uint32_t newSensitivity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1743 uint16_t newDuration, newOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1744 uint8_t newStopDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1745
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1746 switch(data[0])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1747 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1748 case 0x10:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1749 return setGas(1,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1750 case 0x11:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1751 return setGas(2,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1752 case 0x12:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1753 return setGas(3,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1754 case 0x13:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1755 return setGas(4,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1756 case 0x14:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1757 return setGas(5,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1758 case 0x15:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1759 return setDiluent(1,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1760 case 0x16:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1761 return setDiluent(2,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1762 case 0x17:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1763 return setDiluent(3,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1764 case 0x18:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1765 return setDiluent(4,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1766 case 0x19:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1767 return setDiluent(5,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1768 case 0x1A:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1769 return setSetpoint(1,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1770 case 0x1B:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1771 return setSetpoint(2,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1772 case 0x1C:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1773 return setSetpoint(3,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1774 case 0x1D:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1775 return setSetpoint(4,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1776 case 0x1E:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1777 return setSetpoint(5,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1778 case 0x1F:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1779 if(!checkValue(data[2],0,1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1780 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1781 Settings.CCR_Mode = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1782 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1783 case 0x20:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1784 if(!checkValue(data[1],0,3))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1785 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1786 Settings.dive_mode = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1787 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1788 case 0x21:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1789 if(!checkValue(data[1],1,2))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1790 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1791 Settings.deco_type.ub.standard = data[1] & 0x0F;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1792 //Settings.deco_type.ub.alternative = (data[1] & 0xF0) >> 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1793 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1794 case 0x22:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1795 if(!checkValue(data[1],100,190))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1796 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1797 Settings.ppO2_max_std = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1798 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1799 case 0x23:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1800 if(!checkValue(data[1],15,15))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1801 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1802 Settings.ppO2_min = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1803 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1804 case 0x24:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1805 if(!checkValue(data[1],0,15))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1806 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1807 Settings.future_TTS = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1808 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1809 case 0x25:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1810 if(!checkValue(data[1],10,99))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1811 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1812 Settings.GF_low = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1813 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1814 case 0x26:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1815 if(!checkValue(data[1],45,99))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1816 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1817 Settings.GF_high = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1818 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1819 case 0x27:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1820 if(!checkValue(data[1],10,99))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1821 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1822 Settings.aGF_low = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1823 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1824 case 0x28:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1825 if(!checkValue(data[1],45,99))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1826 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1827 Settings.aGF_high = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1828 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1829 case 0x29:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1830 if(!checkValue(data[1],0,5))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1831 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1832 Settings.VPM_conservatism.ub.standard = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1833 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1834 case 0x2A:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1835 case 0x2B:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1836 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1837 case 0x2C:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1838 if(!checkValue(data[1],3,9))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1839 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1840 Settings.last_stop_depth_meter = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1841 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1842 case 0x2D:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1843 if(!checkValue(data[1],0,4))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1844 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1845 Settings.brightness = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1846 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1847 case 0x2E:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1848 if(!checkValue(data[1],0,1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1849 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1850 Settings.nonMetricalSystem = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1851 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1852 case 0x2F:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1853 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1854 case 0x30:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1855 if(!checkValue(data[1],0,4))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1856 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1857 Settings.salinity = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1858 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1859 case 0x31:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1860 if(!checkValue(data[1],0,3))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1861 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1862 Settings.tX_colorscheme = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1863 GFX_use_colorscheme(Settings.tX_colorscheme);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1864 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1865 case 0x32:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1866 if(!checkValue(data[1],0,4))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1867 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1868 Settings.selected_language = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1869 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1870 case 0x33:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1871 if(!checkValue(data[1],0,2))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1872 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1873 Settings.date_format = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1874 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1875 case 0x34:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1876 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1877 case 0x35:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1878 if(data[1] & 0x80)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1879 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1880 data[1] = ~(data[1]);
337
38367bb982b8 Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents: 334
diff changeset
1881 if(!checkValue(data[1],0,PRESSURE_OFFSET_LIMIT_MBAR))
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1882 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1883 Settings.offsetPressure_mbar = 0 - data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1884 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1885 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1886 {
337
38367bb982b8 Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents: 334
diff changeset
1887 if(!checkValue(data[1],0,PRESSURE_OFFSET_LIMIT_MBAR))
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1888 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1889 Settings.offsetPressure_mbar = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1890 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1891 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1892 case 0x36:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1893 if(!checkValue(data[1],0,1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1894 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1895 if(data[1])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1896 Settings.safetystopDuration = settingsGetPointerStandard()->safetystopDuration;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1897 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1898 Settings.safetystopDuration = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1899 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1900 case 0x37:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1901 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1902 case 0x38:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1903 if(!checkValue(data[1],0,1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1904 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1905 Settings.fallbackToFixedSetpoint = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1906 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1907 case 0x39:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1908 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1909 case 0x3A:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1910 if(!checkValue(data[1],70,110))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1911 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1912 newSensitivity = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1913 settingsHelperButtonSens_keepPercentageValues(newSensitivity, settingsGetPointer()->ButtonResponsiveness);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1914 setButtonResponsiveness(Settings.ButtonResponsiveness);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1915 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1916 case 0x3B:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1917 // value between 0 and 127
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1918 if(buttonBalanceTranslatorHexToArray(data[1], settingsGetPointer()->buttonBalance))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1919 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1920 settingsHelperButtonSens_keepPercentageValues(settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->ButtonResponsiveness);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1921 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1922 else // value >= 128 (bit 7 set) factory reset
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1923 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1924 getButtonFactorDefaults(&settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->buttonBalance);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1925 settingsHelperButtonSens_keepPercentageValues(settingsGetPointerStandard()->ButtonResponsiveness[3], settingsGetPointer()->ButtonResponsiveness);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1926 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1927 // valid for both:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1928 setButtonResponsiveness(Settings.ButtonResponsiveness);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1929 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1930 case 0x3C:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1931 if(!checkValue(data[1],5,50))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1932 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1933 Settings.gasConsumption_bottom_l_min = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1934 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1935 case 0x3D:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1936 if(!checkValue(data[1],5,50))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1937 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1938 Settings.gasConsumption_deco_l_min = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1939 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1940 case 0x3E:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1941 if(!checkValue(data[1],5,50))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1942 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1943 Settings.gasConsumption_travel_l_min = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1944 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1945 case 0x3F:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1946 case 0x40:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1947 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1948 case 0x41:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1949 if(!checkValue(data[1],0,1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1950 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1951 Settings.alwaysShowPPO2 = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1952 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1953 case 0x42:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1954 if(data[1] & 0x80)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1955 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1956 data[1] = ~(data[1]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1957 if(!checkValue(data[1],0,20))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1958 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1959 Settings.offsetTemperature_centigrad = 0 - data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1960 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1961 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1962 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1963 if(!checkValue(data[1],0,20))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1964 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1965 Settings.offsetTemperature_centigrad = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1966 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1967 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1968 case 0x43:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1969 if(!checkValue(data[1],60,255))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1970 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1971 newDuration = (uint16_t)data[1] + 59;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1972 newDuration /= 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1973 Settings.safetystopDuration = (uint8_t)newDuration;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1974 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1975 case 0x44:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1976 if(!checkValue(data[1],21,61))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1977 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1978 newStopDepth = data[1] + 9;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1979 if(newStopDepth > 60)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1980 newStopDepth = 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1981 newStopDepth /= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1982 Settings.safetystopDepth = newStopDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1983 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1984 case 0x45:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1985 case 0x46:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1986 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1987 case 0x47:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1988 newOffset = data[2] * 256;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1989 newOffset += data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1990 if(newOffset > 9000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1991 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1992 Settings.logbookOffset = newOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1993 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1994 case 0x70:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1995 if(!checkValue(data[1],0,1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1996 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1997 Settings.showDebugInfo = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1998 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1999 case 0x71:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2000 if(!checkValue(data[1],0,(EXTRADISPLAY_END - 1)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2001 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2002 Settings.extraDisplay = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2003 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2004 case 0x72:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2005 if(!checkValue(data[1],0,8))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2006 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2007 Settings.tX_customViewPrimary = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2008 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2009 case 0x73:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2010 if(!checkValue(data[1],0,20))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2011 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2012 Settings.tX_customViewTimeout = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2013 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2014 case 0x74:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2015 if(!checkValue(data[1],1,7))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2016 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2017 Settings.tX_userselectedLeftLowerCornerPrimary = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2018 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2019 case 0x75:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2020 if(!checkValue(data[1],0,20))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2021 return ERROR_;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2022 Settings.tX_userselectedLeftLowerCornerTimeout = data[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2023 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2024 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2025 return 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2026 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2027
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2028
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2029 uint8_t readDataLimits__8and16BitValues_4and7BytesOutput(uint8_t what, uint8_t * data)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2030 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2031 enum JeanDoParameterType {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2032 PARAM_UNKNOWN = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2033 PARAM_INT15 = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2034 PARAM_INT8,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2035 PARAM_DECI,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2036 PARAM_CENTI,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2037 PARAM_MILI,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2038 PARAM_PERCENT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2039 PARAM_SEC,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2040 PARAM_COLOR,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2041 PARAM_BOOL,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2042 PARAM_ENUM,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2043 PARAM_SIGNED = 128,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2044 PARAM_SDECI = PARAM_SIGNED|PARAM_DECI,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2045 PARAM_SSEC = PARAM_SIGNED|PARAM_SEC,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2046 PARAM_SINT = PARAM_SIGNED|PARAM_INT8
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2047 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2048
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2049 // uint32_t buttonSensitivity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2050 uint16_t newDuration;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2051
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2052 uint8_t datacounter = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2053
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2054 data[0] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2055 data[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2056 data[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2057 data[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2058 datacounter = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2059
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2060 switch(what)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2061 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2062 case 0x10:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2063 case 0x11:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2064 case 0x12:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2065 case 0x13:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2066 case 0x14:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2067 data[datacounter++] = PARAM_INT8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2068 data[datacounter++] = 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2069 data[datacounter++] = settingsGetPointerStandard()->gas[1].oxygen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2070 data[datacounter++] = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2071 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2072
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2073 case 0x15:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2074 case 0x16:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2075 case 0x17:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2076 case 0x18:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2077 case 0x19:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2078 data[datacounter++] = PARAM_INT8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2079 data[datacounter++] = 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2080 data[datacounter++] = settingsGetPointerStandard()->gas[1].oxygen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2081 data[datacounter++] = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2082 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2083
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2084 case 0x1A:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2085 case 0x1B:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2086 case 0x1C:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2087 case 0x1D:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2088 case 0x1E:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2089 data[datacounter++] = PARAM_CENTI;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2090 data[datacounter++] = 50;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2091 data[datacounter++] = settingsGetPointerStandard()->setpoint[1].setpoint_cbar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2092 data[datacounter++] = 160;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2093 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2094
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2095 case 0x1F:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2096 data[datacounter++] = PARAM_ENUM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2097 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2098 data[datacounter++] = settingsGetPointerStandard()->CCR_Mode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2099 data[datacounter++] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2100 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2101
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2102 case 0x20:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2103 data[datacounter++] = PARAM_ENUM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2104 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2105 data[datacounter++] = settingsGetPointerStandard()->dive_mode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2106 data[datacounter++] = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2107 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2108
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2109 case 0x21:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2110 data[datacounter++] = PARAM_ENUM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2111 data[datacounter++] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2112 data[datacounter++] = settingsGetPointerStandard()->deco_type.ub.standard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2113 data[datacounter++] = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2114 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2115
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2116 case 0x22:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2117 data[datacounter++] = PARAM_CENTI;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2118 data[datacounter++] = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2119 data[datacounter++] = settingsGetPointerStandard()->ppO2_max_std;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2120 data[datacounter++] = 190;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2121 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2122
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2123 case 0x23:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2124 data[datacounter++] = PARAM_CENTI;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2125 data[datacounter++] = 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2126 data[datacounter++] = settingsGetPointerStandard()->ppO2_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2127 data[datacounter++] = 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2128 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2129
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2130 case 0x24:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2131 data[datacounter++] = PARAM_INT8; // minutes
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2132 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2133 data[datacounter++] = settingsGetPointerStandard()->future_TTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2134 data[datacounter++] = 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2135 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2136
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2137 case 0x25:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2138 data[datacounter++] = PARAM_PERCENT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2139 data[datacounter++] = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2140 data[datacounter++] = settingsGetPointerStandard()->GF_low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2141 data[datacounter++] = 99;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2142 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2143
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2144 case 0x26:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2145 data[datacounter++] = PARAM_PERCENT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2146 data[datacounter++] = 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2147 data[datacounter++] = settingsGetPointerStandard()->GF_high;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2148 data[datacounter++] = 99;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2149 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2150
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2151 case 0x27:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2152 data[datacounter++] = PARAM_PERCENT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2153 data[datacounter++] = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2154 data[datacounter++] = settingsGetPointerStandard()->aGF_low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2155 data[datacounter++] = 99;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2156 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2157
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2158 case 0x28:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2159 data[datacounter++] = PARAM_PERCENT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2160 data[datacounter++] = 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2161 data[datacounter++] = settingsGetPointerStandard()->aGF_high;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2162 data[datacounter++] = 99;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2163 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2164
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2165 case 0x29:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2166 data[datacounter++] = PARAM_INT8; // conservatism +0 .. +5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2167 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2168 data[datacounter++] = settingsGetPointerStandard()->VPM_conservatism.ub.standard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2169 data[datacounter++] = 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2170 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2171
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2172 case 0x2A:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2173 case 0x2B:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2174 data[datacounter++] = PARAM_PERCENT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2175 data[datacounter++] = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2176 data[datacounter++] = 100;// saturation, desaturation, settingsGetPointerStandard()->;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2177 data[datacounter++] = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2178 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2179
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2180 case 0x2C:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2181 data[datacounter++] = PARAM_INT8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2182 data[datacounter++] = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2183 data[datacounter++] = settingsGetPointerStandard()->last_stop_depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2184 data[datacounter++] = 9;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2185 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2186
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2187 case 0x2D:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2188 data[datacounter++] = PARAM_ENUM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2189 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2190 data[datacounter++] = settingsGetPointerStandard()->brightness;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2191 data[datacounter++] = 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2192 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2193
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2194 case 0x2E:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2195 data[datacounter++] = PARAM_ENUM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2196 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2197 data[datacounter++] = settingsGetPointerStandard()->nonMetricalSystem;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2198 data[datacounter++] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2199 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2200
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2201 case 0x2F:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2202 data[datacounter++] = PARAM_INT8; // Sampling rate logbook
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2203 data[datacounter++] = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2204 data[datacounter++] = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2205 data[datacounter++] = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2206 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2207
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2208 case 0x30:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2209 data[datacounter++] = PARAM_PERCENT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2210 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2211 data[datacounter++] = settingsGetPointerStandard()->salinity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2212 data[datacounter++] = 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2213 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2214
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2215 case 0x31:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2216 data[datacounter++] = PARAM_INT8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2217 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2218 data[datacounter++] = settingsGetPointerStandard()->tX_colorscheme;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2219 data[datacounter++] = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2220 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2221
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2222 case 0x32:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2223 data[datacounter++] = PARAM_ENUM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2224 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2225 data[datacounter++] = settingsGetPointerStandard()->selected_language;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2226 data[datacounter++] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2227 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2228
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2229 case 0x33:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2230 data[datacounter++] = PARAM_ENUM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2231 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2232 data[datacounter++] = settingsGetPointerStandard()->date_format;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2233 data[datacounter++] = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2234 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2235
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2236 case 0x34:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2237 data[datacounter++] = PARAM_UNKNOWN ;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2238 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2239 data[datacounter++] = 0; // compass gain, is unknown,, settingsGetPointerStandard()->;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2240 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2241 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2242
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2243 case 0x35:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2244 data[datacounter++] = PARAM_SINT;
337
38367bb982b8 Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents: 334
diff changeset
2245 data[datacounter++] = (uint8_t)(256 - PRESSURE_OFFSET_LIMIT_MBAR); // == -20
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2246 if(settingsGetPointerStandard()->offsetPressure_mbar < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2247 data[datacounter++] = (uint8_t)(127 - settingsGetPointerStandard()->offsetPressure_mbar);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2248 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2249 data[datacounter++] = settingsGetPointerStandard()->offsetPressure_mbar;
337
38367bb982b8 Set Max value for pressure offset to 50mBar (20mBar before)
ideenmodellierer
parents: 334
diff changeset
2250 data[datacounter++] = PRESSURE_OFFSET_LIMIT_MBAR;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2251 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2252
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2253 case 0x36:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2254 data[datacounter++] = PARAM_BOOL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2255 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2256 if(settingsGetPointerStandard()->safetystopDuration)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2257 data[datacounter++] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2258 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2259 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2260 data[datacounter++] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2261 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2262
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2263 case 0x37:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2264 data[datacounter++] = PARAM_UNKNOWN ;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2265 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2266 data[datacounter++] = 0; // Set calibration gas, not possible with optical
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2267 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2268 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2269
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2270 case 0x38:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2271 data[datacounter++] = PARAM_BOOL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2272 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2273 data[datacounter++] = settingsGetPointerStandard()->fallbackToFixedSetpoint;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2274 data[datacounter++] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2275 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2276
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2277 case 0x39:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2278 data[datacounter++] = PARAM_BOOL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2279 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2280 data[datacounter++] = 0; // flipscreen, not yet :-) settingsGetPointerStandard()->;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2281 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2282 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2283
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2284 case 0x3A:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2285 data[datacounter++] = PARAM_PERCENT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2286 data[datacounter++] = 70;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2287 data[datacounter++] = settingsGetPointerStandard()->ButtonResponsiveness[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2288 data[datacounter++] = 110;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2289 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2290
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2291 case 0x3B:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2292 data[datacounter++] = PARAM_UNKNOWN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2293 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2294 data[datacounter++] = buttonBalanceTranslateArrayOutHex(settingsGetPointerStandard()->buttonBalance);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2295 data[datacounter++] = 128;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2296 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2297
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2298 case 0x3C:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2299 data[datacounter++] = PARAM_INT8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2300 data[datacounter++] = 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2301 data[datacounter++] = settingsGetPointerStandard()->gasConsumption_bottom_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2302 data[datacounter++] = 50;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2303 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2304
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2305 case 0x3D:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2306 data[datacounter++] = PARAM_INT8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2307 data[datacounter++] = 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2308 data[datacounter++] = settingsGetPointerStandard()->gasConsumption_deco_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2309 data[datacounter++] = 50;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2310 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2311
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2312 case 0x3E:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2313 data[datacounter++] = PARAM_INT8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2314 data[datacounter++] = 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2315 data[datacounter++] = settingsGetPointerStandard()->gasConsumption_travel_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2316 data[datacounter++] = 50;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2317 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2318
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2319 case 0x3F:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2320 data[datacounter++] = PARAM_UNKNOWN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2321 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2322 data[datacounter++] = 0; // Dynamic ascend rate, not yet :-) settingsGetPointerStandard()->;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2323 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2324 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2325
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2326 case 0x40:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2327 data[datacounter++] = PARAM_BOOL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2328 data[datacounter++] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2329 data[datacounter++] = 1; // Graphical speed indicator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2330 data[datacounter++] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2331 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2332
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2333 case 0x41:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2334 data[datacounter++] = PARAM_BOOL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2335 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2336 data[datacounter++] = settingsGetPointerStandard()->alwaysShowPPO2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2337 data[datacounter++] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2338 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2339
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2340 case 0x42:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2341 data[datacounter++] = PARAM_SIGNED|PARAM_CENTI;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2342 data[datacounter++] = (uint8_t)(256 - 20); // == -20
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2343 if(settingsGetPointerStandard()->offsetTemperature_centigrad < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2344 data[datacounter++] = (uint8_t)(127 - settingsGetPointerStandard()->offsetTemperature_centigrad);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2345 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2346 data[datacounter++] = settingsGetPointerStandard()->offsetTemperature_centigrad;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2347 data[datacounter++] = 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2348 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2349
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2350 case 0x43:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2351 newDuration = settingsGetPointerStandard()->safetystopDuration;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2352 newDuration *= 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2353 if(newDuration > 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2354 newDuration = 255;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2355 data[datacounter++] = PARAM_INT8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2356 data[datacounter++] = 60; // coud be 1 minute instead
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2357 data[datacounter++] = (uint8_t)newDuration;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2358 data[datacounter++] = 255; // could be 5 minutes instead
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2359 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2360
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2361 case 0x44:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2362 data[datacounter++] = PARAM_INT8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2363 data[datacounter++] = 30; // coud be 3 meter instead
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2364 data[datacounter++] = settingsGetPointerStandard()->safetystopDepth * 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2365 data[datacounter++] = 60; // could be 6 meter instead
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2366 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2367
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2368 case 0x45:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2369 case 0x46:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2370 data[datacounter++] = PARAM_UNKNOWN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2371 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2372 data[datacounter++] = 0; // SafetyStop End Depth and SafetyStop Reset Depth
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2373 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2374 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2375
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2376 case 0x47:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2377 data[datacounter++] = PARAM_INT15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2378 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2379 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2380 data[datacounter++] = settingsGetPointerStandard()->logbookOffset & 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2381 data[datacounter++] = settingsGetPointerStandard()->logbookOffset / 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2382 data[datacounter++] = 9000 & 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2383 data[datacounter++] = 9000 / 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2384 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2385
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2386 case 0x70:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2387 data[datacounter++] = PARAM_BOOL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2388 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2389 data[datacounter++] = settingsGetPointerStandard()->showDebugInfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2390 data[datacounter++] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2391 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2392
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2393 case 0x71:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2394 data[datacounter++] = PARAM_ENUM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2395 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2396 data[datacounter++] = settingsGetPointerStandard()->extraDisplay;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2397 data[datacounter++] = (EXTRADISPLAY_END - 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2398 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2399
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2400 case 0x72:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2401 data[datacounter++] = PARAM_ENUM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2402 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2403 data[datacounter++] = settingsGetPointerStandard()->tX_customViewPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2404 data[datacounter++] = 8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2405 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2406
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2407 case 0x73:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2408 data[datacounter++] = PARAM_INT8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2409 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2410 data[datacounter++] = settingsGetPointerStandard()->tX_customViewTimeout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2411 data[datacounter++] = 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2412 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2413
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2414 case 0x74:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2415 data[datacounter++] = PARAM_ENUM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2416 data[datacounter++] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2417 data[datacounter++] = settingsGetPointerStandard()->tX_userselectedLeftLowerCornerPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2418 data[datacounter++] = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2419 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2420
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2421 case 0x75:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2422 data[datacounter++] = PARAM_INT8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2423 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2424 data[datacounter++] = settingsGetPointerStandard()->tX_userselectedLeftLowerCornerTimeout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2425 data[datacounter++] = 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2426 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2427 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2428
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2429 if(datacounter == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2430 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2431 data[datacounter++] = PARAM_UNKNOWN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2432 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2433 data[datacounter++] = 0; // SafetyStop End Depth and SafetyStop Reset Depth
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2434 data[datacounter++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2435 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2436
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2437 return datacounter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2438 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2439
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2440
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2441 uint8_t readData(uint8_t what, uint8_t * data)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2442 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2443 data[0] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2444 data[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2445 data[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2446 data[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2447 switch(what)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2448 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2449 case 0x10:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2450 return getGas(1,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2451 case 0x11:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2452 return getGas(2,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2453 case 0x12:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2454 return getGas(3,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2455 case 0x13:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2456 return getGas(4,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2457 case 0x14:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2458 return getGas(5,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2459 case 0x15:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2460 return getDiluent(1,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2461 case 0x16:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2462 return getDiluent(2,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2463 case 0x17:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2464 return getDiluent(3,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2465 case 0x18:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2466 return getDiluent(4,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2467 case 0x19:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2468 return getDiluent(5,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2469 case 0x1A:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2470 return getSetpoint(1,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2471 case 0x1B:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2472 return getSetpoint(2,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2473 case 0x1C:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2474 return getSetpoint(3,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2475 case 0x1D:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2476 return getSetpoint(4,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2477 case 0x1E:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2478 return getSetpoint(5,data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2479 case 0x1F:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2480 data[0] = Settings.CCR_Mode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2481 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2482 case 0x20:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2483 data[0] = Settings.dive_mode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2484 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2485 case 0x21:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2486 data[0] = Settings.deco_type.ub.standard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2487 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2488 case 0x22:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2489 data[0] = Settings.ppO2_max_std;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2490 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2491 case 0x23:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2492 data[0] = Settings.ppO2_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2493 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2494 case 0x24:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2495 data[0] = Settings.future_TTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2496 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2497 case 0x25:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2498 data[0] = Settings.GF_low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2499 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2500 case 0x26:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2501 data[0] = Settings.GF_high;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2502 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2503 case 0x27:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2504 data[0] = Settings.aGF_low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2505 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2506 case 0x28:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2507 data[0] = Settings.aGF_high;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2508 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2509 case 0x29:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2510 data[0] = Settings.VPM_conservatism.ub.standard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2511 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2512 case 0x2A:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2513 case 0x2B:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2514 data[0] = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2515 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2516 case 0x2C:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2517 data[0] = Settings.last_stop_depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2518 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2519 case 0x2D:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2520 data[0] = Settings.brightness;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2521 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2522 case 0x2E:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2523 data[0] = Settings.nonMetricalSystem;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2524 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2525 case 0x2F:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2526 data[0] = 0; // 0 == 2 sec sampling rate
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2527 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2528 case 0x30:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2529 data[0] = Settings.salinity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2530 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2531 case 0x31:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2532 data[0] = Settings.tX_colorscheme;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2533 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2534 case 0x32:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2535 data[0] = Settings.selected_language;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2536 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2537 case 0x33:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2538 data[0] = Settings.date_format;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2539 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2540 case 0x34:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2541 data[0] = 7; // gain should be always 7 as far as I understand the code in RTE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2542 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2543 case 0x35:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2544 data[0] = Settings.offsetPressure_mbar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2545 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2546 case 0x36:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2547 if(Settings.safetystopDepth)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2548 data[0] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2549 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2550 data[0] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2551 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2552 case 0x37:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2553 data[0] = 0; // calibration gas %O2 -> 0 no gas :-)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2554 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2555 case 0x38:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2556 data[0] = Settings.fallbackToFixedSetpoint;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2557 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2558 case 0x39:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2559 data[0] = 0; // flip screen
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2560 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2561 case 0x3A:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2562 data[0] = Settings.ButtonResponsiveness[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2563 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2564 case 0x3B:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2565 data[0] = buttonBalanceTranslateArrayOutHex(settingsGetPointer()->buttonBalance);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2566 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2567 case 0x3C:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2568 data[0] = Settings.gasConsumption_bottom_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2569 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2570 case 0x3D:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2571 data[0] = Settings.gasConsumption_deco_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2572 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2573 case 0x3E:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2574 data[0] = Settings.gasConsumption_travel_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2575 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2576 case 0x3F:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2577 data[0] = 0; // fixed ascend rate 10 m/min
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2578 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2579 case 0x40:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2580 data[0] = 1; // graphical speed indicator
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2581 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2582 case 0x41:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2583 data[0] = Settings.alwaysShowPPO2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2584 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2585 case 0x42:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2586 data[0] = Settings.offsetTemperature_centigrad;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2587 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2588 case 0x43:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2589 if(Settings.safetystopDuration > 4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2590 data[0] = 255; // seconds
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2591 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2592 data[0] = 60 * Settings.safetystopDuration;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2593 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2594 case 0x44:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2595 data[0] = Settings.safetystopDepth * 10; // cbar instead of meter
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2596 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2597 case 0x45:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2598 if(Settings.safetystopDepth == 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2599 data[0] = 20; // cbar
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2600 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2601 data[0] = 30; // cbar
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2602 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2603 case 0x46:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2604 data[0] = 10; // reset at 10 meter as far as I understood
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2605 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2606 case 0x47:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2607 data[0] = Settings.logbookOffset & 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2608 data[1] = Settings.logbookOffset / 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2609 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2610 case 0x70:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2611 data[0] = Settings.showDebugInfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2612 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2613 case 0x71:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2614 data[0] = Settings.extraDisplay;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2615 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2616 case 0x72:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2617 data[0] = Settings.tX_customViewPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2618 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2619 case 0x73:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2620 data[0] = Settings.tX_customViewTimeout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2621 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2622 case 0x74:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2623 data[0] = Settings.tX_userselectedLeftLowerCornerPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2624 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2625 case 0x75:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2626 data[0] = Settings.tX_userselectedLeftLowerCornerTimeout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2627 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2628 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2629 return 0x4D;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2630 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2631
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2632
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2633 uint8_t RTEminimum_required_high(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2634 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2635 return RTErequiredHigh;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2636 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2637 uint8_t RTEminimum_required_low(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2638 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2639 return RTErequiredLow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2640 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2641
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2642 uint8_t FONTminimum_required_high(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2643 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2644 return FONTrequiredHigh;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2645 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2646 uint8_t FONTminimum_required_low(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2647 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2648 return FONTrequiredLow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2649 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2650
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2651
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2652 void setActualRTEversion(uint8_t high, uint8_t low)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2653 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2654 RTEactualHigh = high;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2655 RTEactualLow = low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2656 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2657
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2658
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2659 void getActualRTEandFONTversion(uint8_t *RTEhigh, uint8_t *RTElow, uint8_t *FONThigh, uint8_t *FONTlow)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2660 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2661 if(RTEhigh && RTElow)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2662 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2663 *RTEhigh = RTEactualHigh;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2664 *RTElow = RTEactualLow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2665 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2666 if(FONThigh && FONTlow)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2667 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2668 *FONThigh = *(uint8_t *)0x08132000;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2669 *FONTlow = *(uint8_t *)0x08132001;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2670 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2671 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2672
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2673
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2674 uint8_t getLicence(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2675 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2676 return hardwareDataGetPointer()->primaryLicence;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2677 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2678
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2679
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2680 void firmwareGetDate(RTC_DateTypeDef *SdateOutput)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2681 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2682 SdateOutput->Year = firmwareDataGetPointer()->release_year;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2683 SdateOutput->Month = firmwareDataGetPointer()->release_month;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2684 SdateOutput->Date = firmwareDataGetPointer()->release_day;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2685 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2686
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2687
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2688 // this should use device specific values stored in OTPROG ROM soon
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2689 void getButtonFactorDefaults(uint8_t* basePercentage, uint8_t* buttonBalanceArray)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2690 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2691 *basePercentage = settingsGetPointerStandard()->ButtonResponsiveness[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2692
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2693 for(int i=0;i<3;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2694 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2695 buttonBalanceArray[i] = settingsGetPointerStandard()->buttonBalance[i];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2696 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2697 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2698
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2699
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2700 uint8_t buttonBalanceTranslatorHexToArray(uint8_t hexValue, uint8_t* outputArray)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2701 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2702 if(hexValue > 127)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2703 return 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2704 // internal order: 0 = right, 1 = center, 2 = left
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2705 // external order: Factory,left,center,right
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2706 outputArray[0] = 2 + (hexValue & 0x03);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2707 hexValue /= 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2708 outputArray[1] = 2 + (hexValue & 0x03);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2709 hexValue /= 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2710 outputArray[2] = 2 + (hexValue & 0x03);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2711
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2712 return 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2713 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2714
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2715
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2716 uint8_t buttonBalanceTranslateArrayOutHex(const uint8_t* inputArray)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2717 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2718 uint8_t hexValue = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2719
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2720 if(inputArray[2] > 2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2721 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2722 hexValue += inputArray[2] - 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2723 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2724 hexValue *= 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2725
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2726 if(inputArray[1] > 2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2727 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2728 hexValue += inputArray[1] - 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2729 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2730 hexValue *= 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2731 if(inputArray[0] > 2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2732 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2733 hexValue += inputArray[0] - 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2734 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2735 return hexValue;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2736 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2737
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2738 void settingsWriteFactoryDefaults(uint8_t inputValueRaw, uint8_t *inputBalanceArray)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2739 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2740 if((inputValueRaw >= 70) && (inputValueRaw <= 110))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2741 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2742 Settings.FactoryButtonBase = inputValueRaw;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2743 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2744 for(int i=0;i<3;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2745 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2746 if((inputBalanceArray[i] >= 2) && (inputBalanceArray[i] <= 5))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2747 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2748 Settings.FactoryButtonBalance[i] = inputBalanceArray[i];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2749 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2750 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2751 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2752
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2753
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2754 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2755 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2756 * @brief settingsHelperButtonSens. / make 32 bit input to three buttons + storage value in [3]
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2757 * @author heinrichs weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2758 * @version V 01
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2759 * @date 19-Sept-2016
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2760 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2761 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2762 * @param inputValueRaw:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2763 * @param outArray4Values: [0] is right, [1] is center, [2] is left, [3] is original value with zero balance
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2764 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2765 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2766 void settingsHelperButtonSens_keepPercentageValues(uint32_t inputValueRaw, uint8_t *outArray4Values)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2767 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2768 uint32_t newSensitivity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2769
92
be35821a4974 Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents: 91
diff changeset
2770 if(inputValueRaw > MAX_BUTTONRESPONSIVENESS)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2771 {
92
be35821a4974 Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents: 91
diff changeset
2772 inputValueRaw = MAX_BUTTONRESPONSIVENESS;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2773 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2774 else
92
be35821a4974 Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents: 91
diff changeset
2775 if(inputValueRaw < MIN_BUTTONRESPONSIVENESS)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2776 {
92
be35821a4974 Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents: 91
diff changeset
2777 inputValueRaw = MIN_BUTTONRESPONSIVENESS;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2778 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2779
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2780 // the unbalanced value
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2781 outArray4Values[3] = inputValueRaw;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2782
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2783 // the balanced values
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2784 for(int i=0;i<3;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2785 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2786 newSensitivity = inputValueRaw;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2787 switch(settingsGetPointer()->buttonBalance[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2788 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2789 case 1: // should not be an option hw 170508
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2790 newSensitivity -= 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2791 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2792 case 2:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2793 newSensitivity -= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2794 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2795 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2796 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2797 case 4:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2798 newSensitivity += 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2799 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2800 case 5:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2801 newSensitivity += 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2802 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2803 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2804
92
be35821a4974 Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents: 91
diff changeset
2805 if(newSensitivity > MAX_BUTTONRESPONSIVENESS)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2806 {
92
be35821a4974 Stable to test. button sensitiveness fix. + global_constants.
Dmitry Romanov <kitt@bk.ru>
parents: 91
diff changeset
2807 newSensitivity = MAX_BUTTONRESPONSIVENESS;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2808 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2809 outArray4Values[i] = newSensitivity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2810 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2811 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2812
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2813
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2814 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2815 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2816 * @brief settingsHelperButtonSens_translate_to_hwOS_values. / make 32 bit input to three buttons + storage value in [3]
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2817 * @author heinrichs weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2818 * @version V 01
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2819 * @date 19-Sept-2016
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2820 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2821 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2822 * @param inputValueRaw:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2823 * @param outArray4Values: [0] is right, [1] is center, [2] is left, [3] is original value with zero balance
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2824 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2825 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2826 void settingsHelperButtonSens_original_translate_to_hwOS_values(const uint32_t inputValueRaw, uint8_t *outArray4Values)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2827 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2828 uint32_t newSensitivity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2829
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2830 for(int i=0;i<3;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2831 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2832 newSensitivity = inputValueRaw;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2833 switch(settingsGetPointer()->buttonBalance[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2834 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2835 case 1:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2836 newSensitivity -= 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2837 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2838 case 2:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2839 newSensitivity -= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2840 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2841 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2842 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2843 case 4:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2844 newSensitivity += 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2845 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2846 case 5:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2847 newSensitivity += 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2848 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2849 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2850
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2851 if(newSensitivity > 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2852 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2853 if(newSensitivity <= 105)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2854 newSensitivity = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2855 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2856 newSensitivity = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2857 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2858 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2859 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2860 newSensitivity *= 24;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2861 newSensitivity = 2400 - newSensitivity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2862 newSensitivity /= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2863
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2864 newSensitivity += 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2865 if(newSensitivity > 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2866 newSensitivity = 255;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2867 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2868 outArray4Values[i] = newSensitivity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2869 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2870
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2871 // the unbalanced value
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2872 newSensitivity = inputValueRaw;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2873 if(newSensitivity > 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2874 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2875 if(newSensitivity <= 105)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2876 newSensitivity = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2877 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2878 newSensitivity = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2879 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2880 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2881 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2882 newSensitivity *= 24;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2883 newSensitivity = 2400 - newSensitivity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2884 newSensitivity /= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2885
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2886 newSensitivity += 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2887 if(newSensitivity > 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2888 newSensitivity = 255;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2889 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2890 outArray4Values[3] = newSensitivity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2891 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2892
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2893
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2894 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2895 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2896 * @brief settingsHelperButtonSens_translate_percentage_to_hwOS_values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2897 * @author heinrichs weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2898 * @version V 01
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2899 * @date 6-March-2017
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2900 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2901 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2902 * @param inputValuePercentage with buttonBalance included
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2903 * @retval PIC compatible value
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2904 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2905 uint8_t settingsHelperButtonSens_translate_percentage_to_hwOS_values(uint8_t inputValuePercentage)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2906 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2907 uint32_t newSensitivity = inputValuePercentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2908
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2909 if(newSensitivity > 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2910 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2911 if(newSensitivity <= 105)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2912 newSensitivity = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2913 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2914 newSensitivity = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2915 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2916 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2917 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2918 newSensitivity *= 24;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2919 newSensitivity = 2400 - newSensitivity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2920 newSensitivity /= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2921
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2922 newSensitivity += 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2923 if(newSensitivity > 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2924 newSensitivity = 255;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2925 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2926 return (uint8_t)newSensitivity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2927 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2928
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2929
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2930 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2931 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2932 * @brief settingsHelperButtonSens_translate_hwOS_values_to_percentage.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2933 * @author heinrichs weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2934 * @version V 01
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2935 * @date 6-March-2017
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2936 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2937 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2938 * @param PIC compatible value
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2939 * @retval Percentage
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2940 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2941 uint8_t settingsHelperButtonSens_translate_hwOS_values_to_percentage(uint8_t inputValuePIC)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2942 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2943 if(inputValuePIC >= 15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2944 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2945 return(uint8_t)((25500 - (inputValuePIC)*100) / 240);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2946 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2947 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2948 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2949 if(inputValuePIC >= 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2950 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2951 return 105;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2952 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2953 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2954 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2955 return 110;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2956 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2957 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2958 }
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
2959
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
2960 void reset_SettingWarning()
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
2961 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
2962 settingsWarning = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
2963 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
2964 inline uint8_t isSettingsWarning()
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
2965 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
2966 return settingsWarning;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
2967 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 657
diff changeset
2968