diff options
-rw-r--r-- | stmhal/rtc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/stmhal/rtc.c b/stmhal/rtc.c index 00821cabb3..91dae0d6eb 100644 --- a/stmhal/rtc.c +++ b/stmhal/rtc.c @@ -464,7 +464,7 @@ mp_obj_t pyb_rtc_wakeup(mp_uint_t n_args, const mp_obj_t *args) { // set WUTIE to enable wakeup interrupts // set WUTE to enable wakeup // program WUCKSEL - RTC->CR |= (1 << 14) | (1 << 10) | (wucksel & 7); + RTC->CR = (RTC->CR & ~7) | (1 << 14) | (1 << 10) | (wucksel & 7); // enable register write protection RTC->WPR = 0xff; |