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

Thanks to Peter Hinch.  See issue #1490.
This commit is contained in:
Damien George 2015-10-06 23:39:57 +01:00
parent 37ab061f4d
commit fa391eed9d

View File

@ -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;