stm32: rtc: clear wakeup clock selection
Clear wakeup clock selection before setting the desired bits, so no old bits can stay set Reviewed-by: Karl Palsson <karlp@tweak.net.au>
This commit is contained in:
parent
b8424263e8
commit
833ddd9b0a
@ -107,6 +107,7 @@ void rtc_set_wakeup_time(uint16_t wkup_time, uint8_t rtc_cr_wucksel)
|
||||
* down-counting.
|
||||
*/
|
||||
RTC_WUTR = wkup_time;
|
||||
RTC_CR &= ~(RTC_CR_WUCLKSEL_MASK << RTC_CR_WUCLKSEL_SHIFT);
|
||||
RTC_CR |= (rtc_cr_wucksel << RTC_CR_WUCLKSEL_SHIFT);
|
||||
RTC_CR |= RTC_CR_WUTE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user