Commit fa391eed authored by Damien George's avatar Damien George
Browse files

stmhal: In RTC.wakeup, fix setting of wucksel to get correct period.

Thanks to Peter Hinch.  See issue #1490.
parent 37ab061f
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment