comparison Discovery/Src/base.c @ 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 b018e1f3082e
children
comparison
equal deleted inserted replaced
1056:b241efe09963 1057:24c1e3367a2e
553 553
554 updateSetpointStateUsed(); 554 updateSetpointStateUsed();
555 if(stateUsed == stateSimGetPointer()) 555 if(stateUsed == stateSimGetPointer())
556 { 556 {
557 simulation_UpdateLifeData(1); 557 simulation_UpdateLifeData(1);
558 if(stateUsed != stateSimGetPointer()) /* simulation end? => reset timeout */
559 {
560 time_without_button_pressed_deciseconds = 0;
561 }
558 } 562 }
559 check_warning(); 563 check_warning();
560 updateMiniLiveLogbook(1); 564 updateMiniLiveLogbook(1);
561 #ifdef T7_DEBUG_RUNTIME 565 #ifdef T7_DEBUG_RUNTIME
562 startTimeGfxLoop = HAL_GetTick(); 566 startTimeGfxLoop = HAL_GetTick();
581 if((settingsGetPointer()->cvAutofocus) && (settingsGetPointer()->design == 3) && (get_globalState() == StD) && (stateUsed->mode == MODE_DIVE)) 585 if((settingsGetPointer()->cvAutofocus) && (settingsGetPointer()->design == 3) && (get_globalState() == StD) && (stateUsed->mode == MODE_DIVE))
582 { 586 {
583 t3_handleAutofocus(); 587 t3_handleAutofocus();
584 } 588 }
585 #ifdef SIM_WRITES_LOGBOOK 589 #ifdef SIM_WRITES_LOGBOOK
586 if(stateUsed == stateSimGetPointer()) 590 if(stateUsed == stateSimGetPointer())
587 logbook_InitAndWrite(stateUsed); 591 logbook_InitAndWrite((SDiveState*)stateUsed);
588 #endif 592 #else
589 if(stateUsed == stateRealGetPointer()) /* Handle log entries while in dive mode*/ 593 if(stateUsed == stateRealGetPointer()) /* Handle log entries while in dive mode*/
590 logbook_InitAndWrite((SDiveState*)stateUsed); 594 logbook_InitAndWrite((SDiveState*)stateUsed);
595 #endif
591 } 596 }
592 #ifdef T7_DEBUG_RUNTIME 597 #ifdef T7_DEBUG_RUNTIME
593 timeMainLoop = time_elapsed_ms(startTimeMainLoop, HAL_GetTick()); 598 timeMainLoop = time_elapsed_ms(startTimeMainLoop, HAL_GetTick());
594 #endif 599 #endif
595 } 600 }