fixed bug not going to standby correctly
This commit is contained in:
@@ -52,6 +52,9 @@ void BSP_POWER_WakeUp() {
|
|||||||
*/
|
*/
|
||||||
void BSP_POWER_EnterStandby() {
|
void BSP_POWER_EnterStandby() {
|
||||||
|
|
||||||
|
// stop the sytem interrupts
|
||||||
|
__disable_irq();
|
||||||
|
|
||||||
// We need to disable all Periperals to minimize parasitic currents
|
// We need to disable all Periperals to minimize parasitic currents
|
||||||
HAL_I2C_DeInit(&hi2c1);
|
HAL_I2C_DeInit(&hi2c1);
|
||||||
HAL_I2C_MspDeInit(&hi2c1);
|
HAL_I2C_MspDeInit(&hi2c1);
|
||||||
@@ -108,6 +111,13 @@ void BSP_POWER_EnterStandby() {
|
|||||||
/* Enter the Standby mode */
|
/* Enter the Standby mode */
|
||||||
HAL_PWR_EnterSTANDBYMode();
|
HAL_PWR_EnterSTANDBYMode();
|
||||||
|
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
// if we are here, something went wrong
|
||||||
|
NVIC_SystemReset();
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t sec_without_k15 = 0;
|
uint32_t sec_without_k15 = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user