comparison Discovery/Src/tHome.c @ 777:6a8cf91e5b22

This is only showing if one of the compass views is visible. It should make it possible to verify that a correct heading is set as the user can see the compass readout when pushing the button. (mikeller)
author heinrichsweikamp
date Mon, 22 May 2023 09:14:27 +0200
parents 46c6d2380d4e
children dd7ce655db26
comparison
equal deleted inserted replaced
775:46c6d2380d4e 777:6a8cf91e5b22
175 } 175 }
176 #endif 176 #endif
177 } 177 }
178 } else { 178 } else {
179 set_globalState(StD); 179 set_globalState(StD);
180 }
181 }
182
183
184 static void checkSetStateCompassSim(SSettings *settings)
185 {
186 if (settings->design == 7 && t7_isCompassShowing()) {
187 set_globalState(StDBEAR);
188 } else {
189 checkSetStateSim(settings);
180 } 190 }
181 } 191 }
182 192
183 193
184 void tHomeDiveMenuControl(uint8_t sendAction) 194 void tHomeDiveMenuControl(uint8_t sendAction)
275 set_globalState(StDBAILOUT); 285 set_globalState(StDBAILOUT);
276 286
277 break; 287 break;
278 } 288 }
279 289
280 checkSetStateSim(settings); 290 checkSetStateCompassSim(settings);
281 291
282 break; 292 break;
283 case StDBAILOUT: 293 case StDBAILOUT:
284 if (settingsGetPointer()->dive_mode == DIVEMODE_CCR && isLoopMode(stateUsed->diveSettings.diveMode) && findSwitchToSetpoint()) { 294 if (settingsGetPointer()->dive_mode == DIVEMODE_CCR && isLoopMode(stateUsed->diveSettings.diveMode) && findSwitchToSetpoint()) {
285 set_globalState(StDSETPOINT); 295 set_globalState(StDSETPOINT);
286 296
287 break; 297 break;
288 } 298 }
289 299
290 checkSetStateSim(settings); 300 checkSetStateCompassSim(settings);
291 301
292 break; 302 break;
293 case StDSETPOINT: 303 case StDSETPOINT:
294 checkSetStateSim(settings); 304 checkSetStateCompassSim(settings);
295 305
296 break; 306 break;
297 case StDSIM1: 307 case StDSIM1:
298 set_globalState(StDSIM2); 308 set_globalState(StDSIM2);
299 break; 309 break;
353 case StDSIM6: 363 case StDSIM6:
354 set_globalState(StD); 364 set_globalState(StD);
355 break; 365 break;
356 #endif 366 #endif
357 case StDBEAR: 367 case StDBEAR:
368 if (settingsGetPointer()->design == 7) {
369 checkSetStateSim(settings);
370
371 break;
372 }
373
358 if(settingsGetPointer()->design == 5) 374 if(settingsGetPointer()->design == 5)
359 { 375 {
360 set_globalState(StDRAVG); 376 set_globalState(StDRAVG);
361 } 377 }
362 378
498 checkSwitchSetpoint(); 514 checkSwitchSetpoint();
499 515
500 set_globalState(StD); 516 set_globalState(StD);
501 517
502 break; 518 break;
503 case StDBEAR: // t5_gauge 519 case StDBEAR: // t5_gauge, t7
504 setCompassHeading((uint16_t)stateUsed->lifeData.compass_heading); 520 setCompassHeading((uint16_t)stateUsed->lifeData.compass_heading);
505 set_globalState(StD); 521 set_globalState(StD);
506 break; 522 break;
507 523
508 case StDRAVG: // t5_gauge 524 case StDRAVG: // t5_gauge