diff --git a/Application/BSP/BSP_POWER.c b/Application/BSP/BSP_POWER.c index 907f902..438a73e 100644 --- a/Application/BSP/BSP_POWER.c +++ b/Application/BSP/BSP_POWER.c @@ -52,6 +52,9 @@ void BSP_POWER_WakeUp() { */ void BSP_POWER_EnterStandby() { + // stop the sytem interrupts + __disable_irq(); + // We need to disable all Periperals to minimize parasitic currents HAL_I2C_DeInit(&hi2c1); HAL_I2C_MspDeInit(&hi2c1); @@ -108,6 +111,13 @@ void BSP_POWER_EnterStandby() { /* Enter the Standby mode */ HAL_PWR_EnterSTANDBYMode(); + while (1) + { + // if we are here, something went wrong + NVIC_SystemReset(); + Error_Handler(); + } + } uint32_t sec_without_k15 = 0;