2023-08-02 03:03 AM
this part in my code completely making my prototype to sleep which should not.As my standby should workout if the main power supply is OFF for 30 seconds.
I have tried shutdown mode and exti thats too behaved the same
Please help what may be wrong
__HAL_RCC_PWR_CLK_ENABLE();
/* Check if the system was resumed from Standby mode */
if (__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)
{
/* Clear Standby flag */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
/* Check and Clear the Wakeup flag */
if (__HAL_PWR_GET_FLAG(PWR_FLAG_WUF4) != RESET)
{
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF4);
}
}
HAL_Delay(30000);
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN4_HIGH);
HAL_PWR_EnterSTANDBYMode();