Mercurial > public > ostc4
diff Discovery/Src/tHome.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 | b2a9e9b02df0 |
children | 8466c994f3e6 |
line wrap: on
line diff
--- a/Discovery/Src/tHome.c Sat Apr 27 09:32:16 2019 +0200 +++ b/Discovery/Src/tHome.c Sat Apr 27 12:27:46 2019 +0200 @@ -285,10 +285,7 @@ break; case StDBEAR: // t5_gauge - if(is_stateUsedSetToSim()) - stateSimGetPointerWrite()->diveSettings.compassHeading = (uint16_t)stateUsed->lifeData.compass_heading; - else - stateRealGetPointerWrite()->diveSettings.compassHeading = (uint16_t)stateUsed->lifeData.compass_heading; + stateUsedWrite->diveSettings.compassHeading = (uint16_t)stateUsed->lifeData.compass_heading; set_globalState(StD); break;