comparison Discovery/Src/tMenuXtra.c @ 816:c4ee952b9425

Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
author heinrichsweikamp
date Sun, 10 Sep 2023 11:46:45 +0200
parents 4c41d9a18c7f
children ffb1036c27c2
comparison
equal deleted inserted replaced
815:ce8f71217f45 816:c4ee952b9425
150 strcpy(&text[textPointer],"\n\r"); 150 strcpy(&text[textPointer],"\n\r");
151 textPointer += 2; 151 textPointer += 2;
152 } 152 }
153 153
154 if((line == 0) || (line == 2)) 154 if((line == 0) || (line == 2))
155 { 155 {
156 bool canDoFallback = pSettings->CCR_Mode == CCRMODE_Sensors; 156 bool canDoFallback = pSettings->CCR_Mode == CCRMODE_Sensors;
157 if (!canDoFallback) { 157 if (!canDoFallback) {
158 text[textPointer++] = '\031'; 158 text[textPointer++] = '\031';
159 } 159 }
160 textPointer += snprintf(&text[textPointer], 60,\ 160 textPointer += snprintf(&text[textPointer], 60,\
161 "%c" 161 "%c"
162 ,TXT_Fallback 162 ,TXT_Fallback
163 ); 163 );
164 164
165 text[textPointer++] = '\t'; 165 text[textPointer++] = '\t';
166 if(settingsGetPointer()->fallbackToFixedSetpoint && canDoFallback) 166 if(settingsGetPointer()->fallbackToFixedSetpoint && canDoFallback)
167 text[textPointer++] = '\005'; 167 text[textPointer++] = '\005';
168 else 168 else
169 text[textPointer++] = '\006'; 169 text[textPointer++] = '\006';
170 170
171 if (!canDoFallback) { 171 if (!canDoFallback) {
172 text[textPointer++] = '\020'; 172 text[textPointer++] = '\020';
173 disableLine(StMXTRA_O2_Fallback); 173 disableLine(StMXTRA_O2_Fallback);
174 } 174 } else {
175 else { 175 enableLine(StMXTRA_O2_Fallback);
176 enableLine(StMXTRA_O2_Fallback); 176 }
177 } 177 strcpy(&text[textPointer],"\n\r");
178 strcpy(&text[textPointer],"\n\r"); 178 textPointer += 2;
179 textPointer += 2; 179 }
180 }
181 180
182 181
183 if((line == 0) || (line == 3)) 182 if((line == 0) || (line == 3))
184 { 183 {
185 textPointer += snprintf(&text[textPointer], 60,\ 184 textPointer += snprintf(&text[textPointer], 60,\
186 "%c" 185 "%c"
187 ,TXT_ScrubTime 186 ,TXT_ScrubTime
188 ); 187 );
189 strcpy(&text[textPointer],"\n\r"); 188 strcpy(&text[textPointer],"\n\r");
190 textPointer += 2; 189 textPointer += 2;
191 } 190 }
192
193
194 191
195 #ifdef ENABLE_PSCR_MODE 192 #ifdef ENABLE_PSCR_MODE
196 if(pSettings->dive_mode == DIVEMODE_PSCR) 193 if(pSettings->dive_mode == DIVEMODE_PSCR)
197 { 194 {
198 if((line == 0) || (line == 4)) 195 if((line == 0) || (line == 4))