annotate Discovery/Src/settings.c @ 952:33e24b77cc6c Evo_2_23

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