Skip to content

Commit 6975d5b

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

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cpu/stm32/periph/rtc_all.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,15 @@ int rtc_set_time(struct tm *time)
345345

346346
int rtc_get_time(struct tm *time)
347347
{
348-
#if defined(CPU_FAM_STM32WL)
349-
/* after waking up from standby, the RSF flag has to be manually cleared */
348+
/* After waking up from standby, the RSF flag has to be manually cleared.
349+
* To be safe, we do it every time even though we might not have been in
350+
* standby before . */
350351
rtc_unlock();
351-
RTC->ICSR &= ~RTC_ICSR_RSF;
352+
RTC_REG_ISR &= ~RTC_ISR_RSF;
352353
rtc_lock();
353354

354355
/* waiting for the RSF bit to be set again before accessing the time */
355-
while (!(RTC_REG_ISR & RTC_ICSR_RSF)) {};
356-
#endif
356+
while (!(RTC_REG_ISR & RTC_ISR_RSF)) {};
357357

358358
/* save current time */
359359
uint32_t tr = RTC->TR;

0 commit comments

Comments
 (0)