stm32: fix stop

This commit is contained in:
xoviat
2023-10-02 18:11:03 -05:00
parent a742a80171
commit e042b3056d
5 changed files with 33 additions and 35 deletions

View File

@@ -340,7 +340,11 @@ impl RtcDriver {
#[cfg(feature = "low-power")]
/// Set the rtc but panic if it's already been set
pub(crate) fn set_rtc(&self, rtc: &'static Rtc) {
critical_section::with(|cs| assert!(self.rtc.borrow(cs).replace(Some(rtc)).is_none()));
critical_section::with(|cs| {
rtc.stop_wakeup_alarm(cs);
assert!(self.rtc.borrow(cs).replace(Some(rtc)).is_none())
});
}
#[cfg(feature = "low-power")]