mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 14:53:03 +00:00
stm32: feature-gate wakeup alarm
This commit is contained in:
parent
db71887817
commit
94de1a5353
@ -89,23 +89,7 @@ impl super::Rtc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// pub(crate) fn clear_wakeup_alarm(&self) {
|
#[cfg(feature = "low-power")]
|
||||||
// use crate::interrupt::typelevel::Interrupt;
|
|
||||||
//
|
|
||||||
// self.write(false, |regs| {
|
|
||||||
// regs.cr().modify(|w| w.set_wutie(false));
|
|
||||||
//
|
|
||||||
// regs.isr().modify(|w| w.set_wutf(false));
|
|
||||||
// crate::pac::PWR.cr1().modify(|w| w.set_cwuf(false));
|
|
||||||
// crate::pac::EXTI.pr(0).modify(|w| w.set_line(22, false));
|
|
||||||
// crate::interrupt::typelevel::RTC_WKUP::unpend();
|
|
||||||
//
|
|
||||||
// regs.cr().modify(|w| w.set_wutie(true));
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
#[cfg(all(feature = "time", any(stm32wb, stm32f4)))]
|
|
||||||
/// start the wakeup alarm and wtih a duration that is as close to but less than
|
/// start the wakeup alarm and wtih a duration that is as close to but less than
|
||||||
/// the requested duration, and record the instant the wakeup alarm was started
|
/// the requested duration, and record the instant the wakeup alarm was started
|
||||||
pub(crate) fn start_wakeup_alarm(&self, requested_duration: embassy_time::Duration) {
|
pub(crate) fn start_wakeup_alarm(&self, requested_duration: embassy_time::Duration) {
|
||||||
@ -145,8 +129,7 @@ impl super::Rtc {
|
|||||||
critical_section::with(|cs| assert!(self.stop_time.borrow(cs).replace(Some(RtcInstant::now())).is_none()))
|
critical_section::with(|cs| assert!(self.stop_time.borrow(cs).replace(Some(RtcInstant::now())).is_none()))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[cfg(feature = "low-power")]
|
||||||
#[cfg(all(feature = "time", any(stm32wb, stm32f4)))]
|
|
||||||
/// stop the wakeup alarm and return the time elapsed since `start_wakeup_alarm`
|
/// stop the wakeup alarm and return the time elapsed since `start_wakeup_alarm`
|
||||||
/// was called, otherwise none
|
/// was called, otherwise none
|
||||||
pub(crate) fn stop_wakeup_alarm(&self) -> Option<embassy_time::Duration> {
|
pub(crate) fn stop_wakeup_alarm(&self) -> Option<embassy_time::Duration> {
|
||||||
|
Loading…
Reference in New Issue
Block a user