Skip to content

Commit fa391ee

Browse files
committed
stmhal: In RTC.wakeup, fix setting of wucksel to get correct period.
Thanks to Peter Hinch. See issue adafruit#1490.
1 parent 37ab061 commit fa391ee

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

stmhal/rtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ mp_obj_t pyb_rtc_wakeup(mp_uint_t n_args, const mp_obj_t *args) {
464464
// set WUTIE to enable wakeup interrupts
465465
// set WUTE to enable wakeup
466466
// program WUCKSEL
467-
RTC->CR |= (1 << 14) | (1 << 10) | (wucksel & 7);
467+
RTC->CR = (RTC->CR & ~7) | (1 << 14) | (1 << 10) | (wucksel & 7);
468468

469469
// enable register write protection
470470
RTC->WPR = 0xff;

0 commit comments

Comments
 (0)