Mercurial > public > ostc4
comparison 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 |
comparison
equal
deleted
inserted
replaced
271:1303747b5ba2 | 272:74a8296a2318 |
---|---|
283 case StDSIM4: | 283 case StDSIM4: |
284 Sim_Divetime(); | 284 Sim_Divetime(); |
285 break; | 285 break; |
286 | 286 |
287 case StDBEAR: // t5_gauge | 287 case StDBEAR: // t5_gauge |
288 if(is_stateUsedSetToSim()) | 288 stateUsedWrite->diveSettings.compassHeading = (uint16_t)stateUsed->lifeData.compass_heading; |
289 stateSimGetPointerWrite()->diveSettings.compassHeading = (uint16_t)stateUsed->lifeData.compass_heading; | |
290 else | |
291 stateRealGetPointerWrite()->diveSettings.compassHeading = (uint16_t)stateUsed->lifeData.compass_heading; | |
292 set_globalState(StD); | 289 set_globalState(StD); |
293 break; | 290 break; |
294 | 291 |
295 case StDRAVG: // t5_gauge | 292 case StDRAVG: // t5_gauge |
296 timer_Stopwatch_Restart(); | 293 timer_Stopwatch_Restart(); |