diff options
| author | xoviat <[email protected]> | 2023-08-26 20:40:21 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-08-26 20:40:21 -0500 |
| commit | 94de1a53530d58cf6db38dffcf434ba19a576d40 (patch) | |
| tree | dbb03c822ac7974fe7de987afd1c06a91fff6032 /embassy-stm32/src | |
| parent | db71887817e665c5c226e8775ad2d5814babac6e (diff) | |
stm32: feature-gate wakeup alarm
Diffstat (limited to 'embassy-stm32/src')
| -rw-r--r-- | embassy-stm32/src/rtc/v2.rs | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/embassy-stm32/src/rtc/v2.rs b/embassy-stm32/src/rtc/v2.rs index d73e7083c..bf926f986 100644 --- a/embassy-stm32/src/rtc/v2.rs +++ b/embassy-stm32/src/rtc/v2.rs | |||
| @@ -89,23 +89,7 @@ impl super::Rtc { | |||
| 89 | } | 89 | } |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | // pub(crate) fn clear_wakeup_alarm(&self) { | 92 | #[cfg(feature = "low-power")] |
| 93 | // use crate::interrupt::typelevel::Interrupt; | ||
| 94 | // | ||
| 95 | // self.write(false, |regs| { | ||
| 96 | // regs.cr().modify(|w| w.set_wutie(false)); | ||
| 97 | // | ||
| 98 | // regs.isr().modify(|w| w.set_wutf(false)); | ||
| 99 | // crate::pac::PWR.cr1().modify(|w| w.set_cwuf(false)); | ||
| 100 | // crate::pac::EXTI.pr(0).modify(|w| w.set_line(22, false)); | ||
| 101 | // crate::interrupt::typelevel::RTC_WKUP::unpend(); | ||
| 102 | // | ||
| 103 | // regs.cr().modify(|w| w.set_wutie(true)); | ||
| 104 | // }); | ||
| 105 | // } | ||
| 106 | |||
| 107 | #[allow(dead_code)] | ||
| 108 | #[cfg(all(feature = "time", any(stm32wb, stm32f4)))] | ||
| 109 | /// start the wakeup alarm and wtih a duration that is as close to but less than | 93 | /// start the wakeup alarm and wtih a duration that is as close to but less than |
| 110 | /// the requested duration, and record the instant the wakeup alarm was started | 94 | /// the requested duration, and record the instant the wakeup alarm was started |
| 111 | pub(crate) fn start_wakeup_alarm(&self, requested_duration: embassy_time::Duration) { | 95 | pub(crate) fn start_wakeup_alarm(&self, requested_duration: embassy_time::Duration) { |
| @@ -145,8 +129,7 @@ impl super::Rtc { | |||
| 145 | critical_section::with(|cs| assert!(self.stop_time.borrow(cs).replace(Some(RtcInstant::now())).is_none())) | 129 | critical_section::with(|cs| assert!(self.stop_time.borrow(cs).replace(Some(RtcInstant::now())).is_none())) |
| 146 | } | 130 | } |
| 147 | 131 | ||
| 148 | #[allow(dead_code)] | 132 | #[cfg(feature = "low-power")] |
| 149 | #[cfg(all(feature = "time", any(stm32wb, stm32f4)))] | ||
| 150 | /// stop the wakeup alarm and return the time elapsed since `start_wakeup_alarm` | 133 | /// stop the wakeup alarm and return the time elapsed since `start_wakeup_alarm` |
| 151 | /// was called, otherwise none | 134 | /// was called, otherwise none |
| 152 | pub(crate) fn stop_wakeup_alarm(&self) -> Option<embassy_time::Duration> { | 135 | pub(crate) fn stop_wakeup_alarm(&self) -> Option<embassy_time::Duration> { |
