trying to improve stabiltiy

This commit is contained in:
2024-05-22 02:39:18 +02:00
parent e892a21f97
commit 2b12ea9602
7 changed files with 126 additions and 39 deletions

View File

@@ -16,6 +16,8 @@
#define STAY_AWAKE_TIME 60 // seconds to stay awake without K15
bool CanDataTask_CarCanActive();
// Start the sleep counter check
void BSP_POWER_Init() {
@@ -52,7 +54,11 @@ void BSP_POWER_WakeUp() {
*/
void BSP_POWER_EnterStandby() {
BSP_SDLogger_Flush();
// if there is still communication on the CAN bus, we should not go to standby
// intstead we should reset the system, because the CAN bus would wake us up again
if (CanDataTask_CarCanActive()) {
NVIC_SystemReset();
}
// stop the sytem interrupts
__disable_irq();