# HG changeset patch # User Ideenmodellierer # Date 1768070929 -3600 # Node ID 24c1e3367a2ea3a34c1d4597352db760beb672d0 # Parent b241efe099635b08dc9edc56c5b635476c475c16 Reset power down timeout after leaving simulator: In the previous version the OSTC immediatly shut down after leaving the simulator if no button had been pressed for a timeout period. In the new version the common timeout for shutdown is reseted to avoid this behavior. diff -r b241efe09963 -r 24c1e3367a2e Discovery/Src/base.c --- a/Discovery/Src/base.c Sat Jan 03 20:42:09 2026 +0100 +++ b/Discovery/Src/base.c Sat Jan 10 19:48:49 2026 +0100 @@ -555,6 +555,10 @@ if(stateUsed == stateSimGetPointer()) { simulation_UpdateLifeData(1); + if(stateUsed != stateSimGetPointer()) /* simulation end? => reset timeout */ + { + time_without_button_pressed_deciseconds = 0; + } } check_warning(); updateMiniLiveLogbook(1); @@ -583,11 +587,12 @@ t3_handleAutofocus(); } #ifdef SIM_WRITES_LOGBOOK - if(stateUsed == stateSimGetPointer()) - logbook_InitAndWrite(stateUsed); -#endif + if(stateUsed == stateSimGetPointer()) + logbook_InitAndWrite((SDiveState*)stateUsed); +#else if(stateUsed == stateRealGetPointer()) /* Handle log entries while in dive mode*/ logbook_InitAndWrite((SDiveState*)stateUsed); +#endif } #ifdef T7_DEBUG_RUNTIME timeMainLoop = time_elapsed_ms(startTimeMainLoop, HAL_GetTick());