mirror of
https://github.com/apache/nuttx.git
synced 2026-08-18 20:18:17 +00:00
STM32 RTC counter: Include enable/disable backup domain within critical section. Per recommendtion of Alexander Oryshchenko.
This commit is contained in:
parent
a907a825c6
commit
aaeb9843d6
1 changed files with 2 additions and 2 deletions
|
|
@ -597,13 +597,13 @@ int up_rtc_settime(FAR const struct timespec *tp)
|
|||
|
||||
/* Enable write access to the backup domain */
|
||||
|
||||
flags = irqsave();
|
||||
(void)stm32_pwr_enablebkp(true);
|
||||
|
||||
/* Then write the broken out values to the RTC counter and BKP overflow register
|
||||
* (hi-res mode only)
|
||||
*/
|
||||
|
||||
flags = irqsave();
|
||||
do
|
||||
{
|
||||
stm32_rtc_beginwr();
|
||||
|
|
@ -617,9 +617,9 @@ int up_rtc_settime(FAR const struct timespec *tp)
|
|||
#ifdef CONFIG_RTC_HIRES
|
||||
putreg16(regvals.ovf, RTC_TIMEMSB_REG);
|
||||
#endif
|
||||
irqrestore(flags);
|
||||
|
||||
(void)stm32_pwr_enablebkp(false);
|
||||
irqrestore(flags);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue