stm32_rtc_endwr(): wait for RTC_CRL_RTOFF bit to be set. This ensures that the write "reaches" RTC registers before access is disabled by stm32_pwr_enablebkp().

This commit is contained in:
Freddie Chopin
2016-01-28 16:58:02 -06:00
committed by Gregory Nutt
parent 5d0c914121
commit 8203659ee5
+7
View File
@@ -229,6 +229,13 @@ static inline void stm32_rtc_beginwr(void)
static inline void stm32_rtc_endwr(void)
{
modifyreg16(STM32_RTC_CRL, RTC_CRL_CNF, 0);
/* Wait for the write to actually reach RTC registers */
while ((getreg16(STM32_RTC_CRL) & RTC_CRL_RTOFF) == 0)
{
up_waste();
}
}
/************************************************************************************