diff options
author | Damien George <damien.p.george@gmail.com> | 2015-10-06 23:39:57 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-10-06 23:39:57 +0100 |
commit | fa391eed9d2598b05ed7e0e10d38d7b597abcd19 (patch) | |
tree | 8ed676978851ad972a8a743dcb46766e7698c900 | |
parent | 37ab061f4d274a909e1a14db07c61110b13512a4 (diff) | |
download | micropython-fa391eed9d2598b05ed7e0e10d38d7b597abcd19.tar.gz micropython-fa391eed9d2598b05ed7e0e10d38d7b597abcd19.zip |
stmhal: In RTC.wakeup, fix setting of wucksel to get correct period.
Thanks to Peter Hinch. See issue #1490.
-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; |