Skip to content

Commit d2e847d

Browse files
committed
fixup! fixup! fixup! fixup! cpu/stm32/periph/rtc: don't stop RTC for every lock
1 parent 6975d5b commit d2e847d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cpu/stm32/periph/rtc_all.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,10 @@ void rtc_init(void)
305305
rtc_unlock();
306306
/* reset configuration */
307307
RTC->CR = 0;
308-
RTC_REG_ISR = RTC_ISR_INIT;
308+
rtc_enter_init_mode();
309309
/* configure prescaler (RTC PRER) */
310310
RTC->PRER = (PRE_SYNC | (PRE_ASYNC << 16));
311+
rtc_exit_init_mode();
311312
rtc_lock();
312313
}
313314

@@ -347,7 +348,7 @@ int rtc_get_time(struct tm *time)
347348
{
348349
/* After waking up from standby, the RSF flag has to be manually cleared.
349350
* To be safe, we do it every time even though we might not have been in
350-
* standby before . */
351+
* standby before. */
351352
rtc_unlock();
352353
RTC_REG_ISR &= ~RTC_ISR_RSF;
353354
rtc_lock();
@@ -450,7 +451,8 @@ void rtc_poweroff(void)
450451

451452
void ISR_NAME(void)
452453
{
453-
#if !(defined(CPU_FAM_STM32L5) || defined(CPU_FAM_STM32WL) || defined(CPU_FAM_STM32G0) || defined(CPU_FAM_STM32U5))
454+
#if !(defined(CPU_FAM_STM32L5) || defined(CPU_FAM_STM32WL) || defined(CPU_FAM_STM32G0) || \
455+
defined(CPU_FAM_STM32U5))
454456
if (RTC_REG_ISR & RTC_ISR_ALRAF) {
455457
if (isr_ctx.cb != NULL) {
456458
isr_ctx.cb(isr_ctx.arg);

0 commit comments

Comments
 (0)