Mercurial > public > ostc4
annotate Discovery/Src/tMenuXtra.c @ 763:aa6006975e76
increase HAL_Delay to 10ms for cold-start-button reset
+ typos and comment changes
author | heinrichsweikamp |
---|---|
date | Sun, 26 Mar 2023 18:34:30 +0200 |
parents | e81afd727993 |
children | 6b248bcdbf28 |
rev | line source |
---|---|
38 | 1 /////////////////////////////////////////////////////////////////////////////// |
2 /// -*- coding: UTF-8 -*- | |
3 /// | |
4 /// \file Discovery/Src/tMenuXtra.c | |
5 /// \brief Menu Xtra - Specials in Divemode like Reset Stopwatch | |
6 /// \author heinrichs weikamp gmbh | |
7 /// \date 02-Mar-2015 | |
8 /// | |
9 /// \details | |
10 /// | |
11 /// $Id$ | |
12 /////////////////////////////////////////////////////////////////////////////// | |
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
14 /// | |
15 /// This program is free software: you can redistribute it and/or modify | |
16 /// it under the terms of the GNU General Public License as published by | |
17 /// the Free Software Foundation, either version 3 of the License, or | |
18 /// (at your option) any later version. | |
19 /// | |
20 /// This program is distributed in the hope that it will be useful, | |
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 /// GNU General Public License for more details. | |
24 /// | |
25 /// You should have received a copy of the GNU General Public License | |
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
27 ////////////////////////////////////////////////////////////////////////////// | |
28 | |
29 /* Includes ------------------------------------------------------------------*/ | |
30 #include <stdio.h> | |
31 #include <string.h> | |
32 #include "tMenu.h" | |
33 #include "tStructure.h" | |
34 #include "tMenuXtra.h" | |
35 #include "text_multilanguage.h" | |
36 #include "data_central.h" | |
37 #include "simulation.h" | |
609
1b243c6c7067
Bugfix: CalibViewport were shown even in case the compile switch had not been set:
Ideenmodellierer
parents:
547
diff
changeset
|
38 #include "configuration.h" |
38 | 39 |
40 /* Exported functions --------------------------------------------------------*/ | |
41 | |
42 uint32_t tMXtra_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext) | |
43 { | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
44 uint8_t textPointer = 0; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
45 uint8_t CcrModusTxtId = 0; |
38 | 46 |
47 textPointer = 0; | |
48 *tab = 500; | |
49 *subtext = 0; | |
50 | |
662 | 51 SSettings *pSettings = settingsGetPointer(); |
52 | |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
53 /* DIVE MODE */ |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
54 if(actual_menu_content != MENU_SURFACE) |
38 | 55 { |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
56 if((line == 0) || (line == 1)) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
57 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
58 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
59 text[textPointer++] = TXT2BYTE_ResetStopwatch; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
60 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
61 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
62 textPointer += 2; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
63 /* |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
64 if((line == 0) || (line == 2)) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
65 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
66 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
67 text[textPointer++] = TXT2BYTE_ResetAvgDepth; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
68 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
69 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
70 textPointer += 2; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
71 */ |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
72 if((line == 0) || (line == 2)) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
73 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
74 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
75 text[textPointer++] = TXT2BYTE_CompassHeading; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
76 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
77 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
78 textPointer += 2; |
38 | 79 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
80 if((line == 0) || (line == 3)) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
81 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
82 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
83 text[textPointer++] = TXT2BYTE_SetMarker; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
84 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
85 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
86 textPointer += 2; |
38 | 87 |
609
1b243c6c7067
Bugfix: CalibViewport were shown even in case the compile switch had not been set:
Ideenmodellierer
parents:
547
diff
changeset
|
88 #ifdef ENABLE_MOTION_CONTROL |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
89 if((line == 0) || (line == 4)) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
90 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
91 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
92 text[textPointer++] = TXT2BYTE_CalibView; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
93 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
94 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
95 textPointer += 2; |
609
1b243c6c7067
Bugfix: CalibViewport were shown even in case the compile switch had not been set:
Ideenmodellierer
parents:
547
diff
changeset
|
96 #endif |
547 | 97 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
98 if(is_stateUsedSetToSim()) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
99 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
100 if((line == 0) || (line == 5)) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
101 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
102 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
103 text[textPointer++] = TXT2BYTE_SimFollowDecoStops; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
104 text[textPointer++] = ' '; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
105 text[textPointer++] = ' '; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
106 if(simulation_get_heed_decostops()) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
107 text[textPointer++] = '\005'; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
108 else |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
109 text[textPointer++] = '\006'; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
110 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
111 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
112 textPointer += 2; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
113 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
114 else |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
115 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
116 if((line == 0) || (line == 5)) /* end dive mode only used during real dives */ |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
117 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
118 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
119 text[textPointer++] = TXT2BYTE_EndDiveMode; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
120 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
121 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
122 textPointer += 2; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
123 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
124 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
125 else /* Surface MODE */ |
38 | 126 { |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
127 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
128 if((line == 0) || (line == 1)) |
38 | 129 { |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
130 switch(pSettings->CCR_Mode) |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
131 { |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
132 case CCRMODE_Sensors: CcrModusTxtId = TXT_Sensor; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
133 break; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
134 case CCRMODE_FixedSetpoint: CcrModusTxtId = TXT_FixedSP; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
135 break; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
136 case CCRMODE_Simulation: CcrModusTxtId = TXT_SimPpo2; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
137 break; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
138 default: CcrModusTxtId = 'X'; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
139 break; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
140 } |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
141 textPointer += snprintf(&text[textPointer], 60,\ |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
142 "%c" |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
143 "\t" |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
144 "%c" |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
145 , TXT_CCRmode |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
146 , CcrModusTxtId |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
147 ); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
148 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
149 strcpy(&text[textPointer],"\n\r"); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
150 textPointer += 2; |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
151 } |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
152 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
153 if((line == 0) || (line == 2)) |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
154 { |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
155 textPointer += snprintf(&text[textPointer], 60,\ |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
156 "%c" |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
157 ,TXT_Fallback |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
158 ); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
159 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
160 text[textPointer++] = '\t'; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
161 if(settingsGetPointer()->fallbackToFixedSetpoint) |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
162 text[textPointer++] = '\005'; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
163 else |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
164 text[textPointer++] = '\006'; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
165 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
166 strcpy(&text[textPointer],"\n\r"); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
167 textPointer += 2; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
168 } |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
169 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
170 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
171 if((line == 0) || (line == 3)) |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
172 { |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
173 textPointer += snprintf(&text[textPointer], 60,\ |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
174 "%c" |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
175 ,TXT_ScrubTime |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
176 ); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
177 strcpy(&text[textPointer],"\n\r"); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
178 textPointer += 2; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
179 } |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
180 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
181 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
182 |
662 | 183 #ifdef ENABLE_PSCR_MODE |
184 if(pSettings->dive_mode == DIVEMODE_PSCR) | |
185 { | |
186 if((line == 0) || (line == 4)) | |
187 { | |
188 textPointer += snprintf(&text[textPointer], 60,\ | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
189 "%c" |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
190 ,TXT_PSClosedCircuit); |
662 | 191 } |
192 } | |
193 #endif | |
194 #ifdef ENABLE_CO2_SUPPORT | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
195 if((line == 0) || (line == 4)) |
662 | 196 { |
197 textPointer += snprintf(&text[textPointer], 60, "%c", TXT_CO2Sensor); | |
198 } | |
199 #endif | |
38 | 200 } |
201 return StMXTRA; | |
202 } | |
203 |