comparison Discovery/Src/base.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 2e58a4094770
children 5ca177d2df5d fc5e9fdcb156
comparison
equal deleted inserted replaced
271:1303747b5ba2 272:74a8296a2318
509 RefreshDisplay(); 509 RefreshDisplay();
510 510
511 // Enable this to make the simulator write a logbook entry 511 // Enable this to make the simulator write a logbook entry
512 // #define SIM_WRITES_LOGBOOK 1 512 // #define SIM_WRITES_LOGBOOK 1
513 513
514 #ifdef SIM_WRITES_LOGBOOK
514 if(stateUsed == stateSimGetPointer()) 515 if(stateUsed == stateSimGetPointer())
515 {
516 #ifdef SIM_WRITES_LOGBOOK
517 logbook_InitAndWrite(stateUsed); 516 logbook_InitAndWrite(stateUsed);
518 #endif 517 #endif
519 }
520
521 if(stateUsed == stateRealGetPointer()) /* Handle log entries while in dive mode*/ 518 if(stateUsed == stateRealGetPointer()) /* Handle log entries while in dive mode*/
522 logbook_InitAndWrite(stateUsed); 519 logbook_InitAndWrite(stateUsed);
523 } 520 }
524 521
525 #ifdef DEBUG_RUNTIME 522 #ifdef DEBUG_RUNTIME