Mercurial > public > ostc4
comparison Discovery/Src/t3.c @ 272:74a8296a2318 write-from-sim
cleanup: simplify stateUsed usage
Get rid of some local stateUsed pointers used to differentiate between
normal dive and simulator mode. Simply use the (properly set) global
data for this. Its rather useless to do this test on countless locations.
Trivial cleanup.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author | Jan Mulder <jlmulder@xs4all.nl> |
---|---|
date | Sat, 27 Apr 2019 12:27:46 +0200 |
parents | ec16fd26e280 |
children | 427ae9f8e28e |
comparison
equal
deleted
inserted
replaced
271:1303747b5ba2 | 272:74a8296a2318 |
---|---|
485 void t3_refresh_customview(float depth) | 485 void t3_refresh_customview(float depth) |
486 { | 486 { |
487 if((t3_selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0)) | 487 if((t3_selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0)) |
488 t3_change_customview(); | 488 t3_change_customview(); |
489 | 489 |
490 SDiveState * pDiveState; | 490 t3_basics_refresh_customview(depth, t3_selection_customview, &t3screen, &t3c1, &t3c2, stateUsedWrite->diveSettings.diveMode); |
491 | |
492 if(stateUsed == stateRealGetPointer()) | |
493 pDiveState = stateRealGetPointerWrite(); | |
494 else | |
495 pDiveState = stateSimGetPointerWrite(); | |
496 | |
497 t3_basics_refresh_customview(depth, t3_selection_customview, &t3screen, &t3c1, &t3c2, pDiveState->diveSettings.diveMode); | |
498 } | 491 } |
499 | 492 |
500 | 493 |
501 void t3_basics_refresh_apnoeRight(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode) | 494 void t3_basics_refresh_apnoeRight(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode) |
502 { | 495 { |