mirror of https://github.com/ARMmbed/mbed-os.git
STM32 LOW_POWER_TIMER update : sleep
RSF synchro after deepsleep is not specific to Low Power Timer feature And we have to check if RTC is configured before synchropull/5738/head
parent
9b8ecab9a9
commit
16a7ecee58
|
@ -101,8 +101,15 @@ void hal_deepsleep(void)
|
|||
TimMasterHandle.Instance = TIM_MST;
|
||||
__HAL_TIM_SET_COUNTER(&TimMasterHandle, EnterTimeUS);
|
||||
|
||||
#if DEVICE_LOWPOWERTIMER
|
||||
#if DEVICE_RTC
|
||||
/* Wait for RTC RSF bit synchro if RTC is configured */
|
||||
#if (TARGET_STM32F2) || (TARGET_STM32F4) || (TARGET_STM32F7)
|
||||
if (READ_BIT(RCC->BDCR, RCC_BDCR_RTCSEL)) {
|
||||
#else /* (TARGET_STM32F2) || (TARGET_STM32F4) || (TARGET_STM32F7) */
|
||||
if (__HAL_RCC_GET_RTC_SOURCE()) {
|
||||
#endif /* (TARGET_STM32F2) || (TARGET_STM32F4) || (TARGET_STM32F7) */
|
||||
rtc_synchronize();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue