changeset 1057:24c1e3367a2e Icon_Integration

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.
author Ideenmodellierer
date Sat, 10 Jan 2026 19:48:49 +0100
parents b241efe09963
children 3c73180fde1d
files Discovery/Src/base.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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());