mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
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:
committed by
Gregory Nutt
parent
5d0c914121
commit
8203659ee5
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user