summaryrefslogtreecommitdiff
path: root/stmhal/rtc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-10-06 23:39:57 +0100
committerDamien George <damien.p.george@gmail.com>2015-10-06 23:39:57 +0100
commitfa391eed9d2598b05ed7e0e10d38d7b597abcd19 (patch)
tree8ed676978851ad972a8a743dcb46766e7698c900 /stmhal/rtc.c
parent37ab061f4d274a909e1a14db07c61110b13512a4 (diff)
stmhal: In RTC.wakeup, fix setting of wucksel to get correct period.
Thanks to Peter Hinch. See issue #1490.
Diffstat (limited to 'stmhal/rtc.c')
-rw-r--r--stmhal/rtc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stmhal/rtc.c b/stmhal/rtc.c
index 00821cabb..91dae0d6e 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;