aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/time_driver.rs
diff options
context:
space:
mode:
authorxoviat <[email protected]>2023-09-15 18:41:33 -0500
committerxoviat <[email protected]>2023-09-15 18:41:33 -0500
commit6da75ea285482bd950b04ae00dde25303f160705 (patch)
tree724ba3dced83647a94aee34f73ddb11bca90b6ae /embassy-stm32/src/time_driver.rs
parent5a158b94bde3a5fee096be213d2afede06d9f019 (diff)
stm32: rtc/low-power cleanup
Diffstat (limited to 'embassy-stm32/src/time_driver.rs')
-rw-r--r--embassy-stm32/src/time_driver.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/embassy-stm32/src/time_driver.rs b/embassy-stm32/src/time_driver.rs
index 99d423d08..887e54f65 100644
--- a/embassy-stm32/src/time_driver.rs
+++ b/embassy-stm32/src/time_driver.rs
@@ -372,6 +372,12 @@ impl RtcDriver {
372 #[cfg(feature = "low-power")] 372 #[cfg(feature = "low-power")]
373 /// Resume the timer with the given offset 373 /// Resume the timer with the given offset
374 pub(crate) fn resume_time(&self) { 374 pub(crate) fn resume_time(&self) {
375 if T::regs_gp16().cr1().read().cen() {
376 // Time isn't currently stopped
377
378 return;
379 }
380
375 self.stop_wakeup_alarm(); 381 self.stop_wakeup_alarm();
376 382
377 T::regs_gp16().cr1().modify(|w| w.set_cen(true)); 383 T::regs_gp16().cr1().modify(|w| w.set_cen(true));