Mercurial > public > ostc4
diff Discovery/Src/tMenuEditXtra.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 | 5f11787b4f42 |
children | ba229a012ac7 |
line wrap: on
line diff
--- a/Discovery/Src/tMenuEditXtra.c Sat Apr 27 09:32:16 2019 +0200 +++ b/Discovery/Src/tMenuEditXtra.c Sat Apr 27 12:27:46 2019 +0200 @@ -121,56 +121,7 @@ uint8_t OnAction_CompassHeading (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) { - 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; exitMenuEdit_to_Home_with_Menu_Update(); return EXIT_TO_HOME; } - - -/* - uint8_t digitContentNew; - uint32_t newHeading; - - if(action == ACTION_BUTTON_ENTER) - { - return digitContent; - } - if(action == ACTION_BUTTON_ENTER_FINAL) - { - evaluateNewString(editId, &newHeading, 0, 0, 0); - if(newHeading > 359) - newHeading = 0; - - if(is_stateUsedSetToSim()) - stateSimGetPointerWrite()->diveSettings.compassHeading = newHeading; - else - stateRealGetPointerWrite()->diveSettings.compassHeading = newHeading; - exitMenuEdit_to_Home_with_Menu_Update(); - return EXIT_TO_HOME; - } - if(action == ACTION_BUTTON_NEXT) - { - digitContentNew = digitContent + 1; - if((digitNumber == 0) && (digitContentNew > '3')) - digitContentNew = '0'; - else - if(digitContentNew > '9') - digitContentNew = '0'; - return digitContentNew; - } - if(action == ACTION_BUTTON_BACK) - { - digitContentNew = digitContent - 1; - if((digitNumber == 0) && (digitContentNew < '0')) - digitContentNew = '3'; - else - if(digitContentNew < '0') - digitContentNew = '9'; - return digitContentNew; - } - - return EXIT_TO_MENU; -*/