annotate Discovery/Src/settings.c @ 492:4ce932235578

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