stm32: rtc/low-power cleanup

This commit is contained in:
xoviat
2023-09-15 18:41:33 -05:00
parent 5a158b94bd
commit 6da75ea285
5 changed files with 63 additions and 83 deletions

View File

@ -372,6 +372,12 @@ impl RtcDriver {
#[cfg(feature = "low-power")]
/// Resume the timer with the given offset
pub(crate) fn resume_time(&self) {
if T::regs_gp16().cr1().read().cen() {
// Time isn't currently stopped
return;
}
self.stop_wakeup_alarm();
T::regs_gp16().cr1().modify(|w| w.set_cen(true));