Mercurial > public > ostc4
annotate Discovery/Src/tMenuXtra.c @ 922:7c996354b8ac Evo_2_23
Moved UART6 into a separate unit:
UART6 connects internal devices. As a first step the existing code sections have been moved into a new unit. As well the code of the external GNSS sensor has been copied into this unit as starting point for the further development. Later the internal part can be integrated into the common uart (code cleanup).
author | Ideenmodellierer |
---|---|
date | Sun, 03 Nov 2024 20:53:05 +0100 |
parents | 7755a476f164 |
children |
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> | |
769
6b248bcdbf28
Deactivation of the 'fallback' option when the CCR mode is set to 'Fixed' - this makes it a little clearer that the option has no influence in this mode.
heinrichsweikamp
parents:
707
diff
changeset
|
32 #include <stdbool.h> |
38 | 33 #include "tMenu.h" |
34 #include "tStructure.h" | |
35 #include "tMenuXtra.h" | |
36 #include "text_multilanguage.h" | |
37 #include "data_central.h" | |
38 #include "simulation.h" | |
609
1b243c6c7067
Bugfix: CalibViewport were shown even in case the compile switch had not been set:
Ideenmodellierer
parents:
547
diff
changeset
|
39 #include "configuration.h" |
38 | 40 |
850
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
41 |
38 | 42 /* Exported functions --------------------------------------------------------*/ |
43 | |
44 uint32_t tMXtra_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext) | |
45 { | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
46 uint8_t textPointer = 0; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
47 uint8_t CcrModusTxtId = 0; |
38 | 48 |
49 textPointer = 0; | |
50 *tab = 500; | |
51 *subtext = 0; | |
52 | |
662 | 53 SSettings *pSettings = settingsGetPointer(); |
54 | |
854 | 55 resetLineMask(StMXTRA); |
56 | |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
57 /* DIVE MODE */ |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
58 if(actual_menu_content != MENU_SURFACE) |
38 | 59 { |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
60 if((line == 0) || (line == 1)) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
61 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
62 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
63 text[textPointer++] = TXT2BYTE_ResetStopwatch; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
64 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
65 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
66 textPointer += 2; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
67 /* |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
68 if((line == 0) || (line == 2)) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
69 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
70 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
71 text[textPointer++] = TXT2BYTE_ResetAvgDepth; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
72 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
73 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
74 textPointer += 2; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
75 */ |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
76 if((line == 0) || (line == 2)) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
77 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
78 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
79 text[textPointer++] = TXT2BYTE_CompassHeading; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
80 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
81 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
82 textPointer += 2; |
38 | 83 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
84 if((line == 0) || (line == 3)) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
85 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
86 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
87 text[textPointer++] = TXT2BYTE_SetMarker; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
88 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
89 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
90 textPointer += 2; |
38 | 91 |
609
1b243c6c7067
Bugfix: CalibViewport were shown even in case the compile switch had not been set:
Ideenmodellierer
parents:
547
diff
changeset
|
92 #ifdef ENABLE_MOTION_CONTROL |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
93 if((line == 0) || (line == 4)) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
94 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
95 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
96 text[textPointer++] = TXT2BYTE_CalibView; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
97 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
98 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
99 textPointer += 2; |
609
1b243c6c7067
Bugfix: CalibViewport were shown even in case the compile switch had not been set:
Ideenmodellierer
parents:
547
diff
changeset
|
100 #endif |
547 | 101 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
102 if(is_stateUsedSetToSim()) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
103 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
104 if((line == 0) || (line == 5)) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
105 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
106 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
107 text[textPointer++] = TXT2BYTE_SimFollowDecoStops; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
108 text[textPointer++] = ' '; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
109 text[textPointer++] = ' '; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
110 if(simulation_get_heed_decostops()) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
111 text[textPointer++] = '\005'; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
112 else |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
113 text[textPointer++] = '\006'; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
114 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
115 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
116 textPointer += 2; |
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 else |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
119 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
120 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
|
121 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
122 text[textPointer++] = TXT_2BYTE; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
123 text[textPointer++] = TXT2BYTE_EndDiveMode; |
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 strcpy(&text[textPointer],"\n\r"); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
126 textPointer += 2; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
127 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
128 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
129 else /* Surface MODE */ |
38 | 130 { |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
131 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
132 if((line == 0) || (line == 1)) |
38 | 133 { |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
134 switch(pSettings->CCR_Mode) |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
135 { |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
136 case CCRMODE_Sensors: CcrModusTxtId = TXT_Sensor; |
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 case CCRMODE_FixedSetpoint: CcrModusTxtId = TXT_FixedSP; |
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 case CCRMODE_Simulation: CcrModusTxtId = TXT_SimPpo2; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
141 break; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
142 default: CcrModusTxtId = 'X'; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
143 break; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
144 } |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
145 textPointer += snprintf(&text[textPointer], 60,\ |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
146 "%c" |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
147 "\t" |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
148 "%c" |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
149 , TXT_CCRmode |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
150 , CcrModusTxtId |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
151 ); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
152 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
153 strcpy(&text[textPointer],"\n\r"); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
154 textPointer += 2; |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
155 } |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
156 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
157 if((line == 0) || (line == 2)) |
816
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
158 { |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
159 bool canDoFallback = pSettings->CCR_Mode == CCRMODE_Sensors; |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
160 if (!canDoFallback) { |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
161 text[textPointer++] = '\031'; |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
162 } |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
163 textPointer += snprintf(&text[textPointer], 60,\ |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
164 "%c" |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
165 ,TXT_Fallback |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
166 ); |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
167 |
816
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
168 text[textPointer++] = '\t'; |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
169 if(settingsGetPointer()->fallbackToFixedSetpoint && canDoFallback) |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
170 text[textPointer++] = '\005'; |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
171 else |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
172 text[textPointer++] = '\006'; |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
173 |
850
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
174 if (!canDoFallback) |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
175 { |
816
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
176 text[textPointer++] = '\020'; |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
177 disableLine(StMXTRA_O2_Fallback); |
850
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
178 } else |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
179 { |
816
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
180 enableLine(StMXTRA_O2_Fallback); |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
181 } |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
182 strcpy(&text[textPointer],"\n\r"); |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
183 textPointer += 2; |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
184 } |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
185 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
186 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
187 if((line == 0) || (line == 3)) |
816
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
188 { |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
189 textPointer += snprintf(&text[textPointer], 60,\ |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
190 "%c" |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
191 ,TXT_ScrubTime |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
192 ); |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
193 strcpy(&text[textPointer],"\n\r"); |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
194 textPointer += 2; |
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
195 } |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
609
diff
changeset
|
196 |
662 | 197 #ifdef ENABLE_PSCR_MODE |
845 | 198 if((line == 0) || (line == 4)) |
199 { | |
200 if(pSettings->dive_mode == DIVEMODE_PSCR) | |
201 { | |
202 textPointer += snprintf(&text[textPointer], 60, "%c",TXT_PSClosedCircuit); | |
203 enableLine(StMXTRA_PSCR_O2_Drop); | |
204 } | |
205 else | |
206 { | |
207 text[textPointer++] = '\031'; /* change text color */ | |
208 textPointer += snprintf(&text[textPointer], 60,"%c",TXT_PSClosedCircuit); | |
209 text[textPointer++] = '\020'; /* restore text color */ | |
210 disableLine(StMXTRA_PSCR_O2_Drop); | |
211 } | |
212 strcpy(&text[textPointer],"\n\r"); | |
213 textPointer += 2; | |
214 } | |
215 #endif | |
883
7755a476f164
Added compile switch for predive check menu:
Ideenmodellierer
parents:
854
diff
changeset
|
216 #ifdef ENABLE_PREDIVE_CHECK |
850
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
217 if((line == 0) || (line == 5)) |
662 | 218 { |
850
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
219 if((pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG) || (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_DIGITAL)) |
845 | 220 { |
850
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
221 textPointer += snprintf(&text[textPointer], 60,"%c",TXT_PreDive); |
845 | 222 } |
850
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
223 else |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
224 { |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
225 text[textPointer++] = '\031'; /* change text color */ |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
226 textPointer += snprintf(&text[textPointer], 60,"%c",TXT_PreDive); |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
227 text[textPointer++] = '\020'; /* restore text color */ |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
228 disableLine(StMXTRA_Predive_Check); |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
229 } |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
230 strcpy(&text[textPointer],"\n\r"); |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
231 textPointer += 2; |
662 | 232 } |
883
7755a476f164
Added compile switch for predive check menu:
Ideenmodellierer
parents:
854
diff
changeset
|
233 #endif |
38 | 234 } |
235 return StMXTRA; | |
236 } | |
237 | |
850
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
238 void tMXtra_checkLineStatus(void) |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
239 { |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
240 uint8_t localLineMask = 0; |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
241 uint8_t lineMask = getLineMask(StMXTRA); |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
242 SSettings *pSettings = settingsGetPointer(); |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
243 |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
244 if(pSettings->CCR_Mode != CCRMODE_Sensors) |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
245 { |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
246 localLineMask |= 1 << 2; |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
247 } |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
248 if(pSettings->dive_mode != DIVEMODE_PSCR) |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
249 { |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
250 localLineMask |= 1 << 4; |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
251 } |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
252 if((pSettings->ppo2sensors_source != O2_SENSOR_SOURCE_ANADIG) && (pSettings->ppo2sensors_source != O2_SENSOR_SOURCE_DIGITAL)) |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
253 { |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
254 localLineMask |= 1 << 5; |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
255 } |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
256 |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
257 if(lineMask != localLineMask) |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
258 { |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
259 updateMenu(); |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
260 } |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
261 } |
bc2fcd002fc4
Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents:
845
diff
changeset
|
262 |