annotate Discovery/Src/settings.c @ 818:40e951cfa443

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