diff options
| -rw-r--r-- | embassy-stm32/src/low_power.rs | 9 | ||||
| -rw-r--r-- | embassy-stm32/src/rtc/low_power.rs | 8 | ||||
| -rw-r--r-- | embassy-stm32/src/rtc/v3.rs | 2 |
3 files changed, 12 insertions, 7 deletions
diff --git a/embassy-stm32/src/low_power.rs b/embassy-stm32/src/low_power.rs index 1423c9538..0b87bd95a 100644 --- a/embassy-stm32/src/low_power.rs +++ b/embassy-stm32/src/low_power.rs | |||
| @@ -70,6 +70,7 @@ use crate::rtc::Rtc; | |||
| 70 | 70 | ||
| 71 | static mut EXECUTOR: Option<Executor> = None; | 71 | static mut EXECUTOR: Option<Executor> = None; |
| 72 | 72 | ||
| 73 | #[cfg(not(stm32u0))] | ||
| 73 | foreach_interrupt! { | 74 | foreach_interrupt! { |
| 74 | (RTC, rtc, $block:ident, WKUP, $irq:ident) => { | 75 | (RTC, rtc, $block:ident, WKUP, $irq:ident) => { |
| 75 | #[interrupt] | 76 | #[interrupt] |
| @@ -80,7 +81,7 @@ foreach_interrupt! { | |||
| 80 | }; | 81 | }; |
| 81 | } | 82 | } |
| 82 | 83 | ||
| 83 | // only relevant for stm32u0 | 84 | #[cfg(stm32u0)] |
| 84 | foreach_interrupt! { | 85 | foreach_interrupt! { |
| 85 | (RTC, rtc, $block:ident, TAMP, $irq:ident) => { | 86 | (RTC, rtc, $block:ident, TAMP, $irq:ident) => { |
| 86 | #[interrupt] | 87 | #[interrupt] |
| @@ -123,10 +124,10 @@ pub enum StopMode { | |||
| 123 | Stop2, | 124 | Stop2, |
| 124 | } | 125 | } |
| 125 | 126 | ||
| 126 | #[cfg(any(stm32l4, stm32l5, stm32u5))] | 127 | #[cfg(any(stm32l4, stm32l5, stm32u5, stm32u0))] |
| 127 | use stm32_metapac::pwr::vals::Lpms; | 128 | use stm32_metapac::pwr::vals::Lpms; |
| 128 | 129 | ||
| 129 | #[cfg(any(stm32l4, stm32l5, stm32u5))] | 130 | #[cfg(any(stm32l4, stm32l5, stm32u5, stm32u0))] |
| 130 | impl Into<Lpms> for StopMode { | 131 | impl Into<Lpms> for StopMode { |
| 131 | fn into(self) -> Lpms { | 132 | fn into(self) -> Lpms { |
| 132 | match self { | 133 | match self { |
| @@ -197,7 +198,7 @@ impl Executor { | |||
| 197 | 198 | ||
| 198 | #[allow(unused_variables)] | 199 | #[allow(unused_variables)] |
| 199 | fn configure_stop(&mut self, stop_mode: StopMode) { | 200 | fn configure_stop(&mut self, stop_mode: StopMode) { |
| 200 | #[cfg(any(stm32l4, stm32l5, stm32u5))] | 201 | #[cfg(any(stm32l4, stm32l5, stm32u5, stm32u0))] |
| 201 | crate::pac::PWR.cr1().modify(|m| m.set_lpms(stop_mode.into())); | 202 | crate::pac::PWR.cr1().modify(|m| m.set_lpms(stop_mode.into())); |
| 202 | #[cfg(stm32h5)] | 203 | #[cfg(stm32h5)] |
| 203 | crate::pac::PWR.pmcr().modify(|v| { | 204 | crate::pac::PWR.pmcr().modify(|v| { |
diff --git a/embassy-stm32/src/rtc/low_power.rs b/embassy-stm32/src/rtc/low_power.rs index 5bf8742de..cf7c4bb28 100644 --- a/embassy-stm32/src/rtc/low_power.rs +++ b/embassy-stm32/src/rtc/low_power.rs | |||
| @@ -65,7 +65,9 @@ pub(crate) enum WakeupPrescaler { | |||
| 65 | Div16 = 16, | 65 | Div16 = 16, |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | #[cfg(any(stm32f4, stm32l0, stm32g4, stm32l4, stm32l5, stm32wb, stm32h5, stm32g0, stm32u5, stm32u0))] | 68 | #[cfg(any( |
| 69 | stm32f4, stm32l0, stm32g4, stm32l4, stm32l5, stm32wb, stm32h5, stm32g0, stm32u5, stm32u0 | ||
| 70 | ))] | ||
| 69 | impl From<WakeupPrescaler> for crate::pac::rtc::vals::Wucksel { | 71 | impl From<WakeupPrescaler> for crate::pac::rtc::vals::Wucksel { |
| 70 | fn from(val: WakeupPrescaler) -> Self { | 72 | fn from(val: WakeupPrescaler) -> Self { |
| 71 | use crate::pac::rtc::vals::Wucksel; | 73 | use crate::pac::rtc::vals::Wucksel; |
| @@ -79,7 +81,9 @@ impl From<WakeupPrescaler> for crate::pac::rtc::vals::Wucksel { | |||
| 79 | } | 81 | } |
| 80 | } | 82 | } |
| 81 | 83 | ||
| 82 | #[cfg(any(stm32f4, stm32l0, stm32g4, stm32l4, stm32l5, stm32wb, stm32h5, stm32g0, stm32u5, stm32u0))] | 84 | #[cfg(any( |
| 85 | stm32f4, stm32l0, stm32g4, stm32l4, stm32l5, stm32wb, stm32h5, stm32g0, stm32u5, stm32u0 | ||
| 86 | ))] | ||
| 83 | impl From<crate::pac::rtc::vals::Wucksel> for WakeupPrescaler { | 87 | impl From<crate::pac::rtc::vals::Wucksel> for WakeupPrescaler { |
| 84 | fn from(val: crate::pac::rtc::vals::Wucksel) -> Self { | 88 | fn from(val: crate::pac::rtc::vals::Wucksel) -> Self { |
| 85 | use crate::pac::rtc::vals::Wucksel; | 89 | use crate::pac::rtc::vals::Wucksel; |
diff --git a/embassy-stm32/src/rtc/v3.rs b/embassy-stm32/src/rtc/v3.rs index d543955a4..de2c202bc 100644 --- a/embassy-stm32/src/rtc/v3.rs +++ b/embassy-stm32/src/rtc/v3.rs | |||
| @@ -139,7 +139,7 @@ impl SealedInstance for crate::peripherals::RTC { | |||
| 139 | const EXTI_WAKEUP_LINE: usize = 17; | 139 | const EXTI_WAKEUP_LINE: usize = 17; |
| 140 | } | 140 | } |
| 141 | ); | 141 | ); |
| 142 | 142 | ||
| 143 | #[cfg(feature = "low-power")] | 143 | #[cfg(feature = "low-power")] |
| 144 | cfg_if::cfg_if!( | 144 | cfg_if::cfg_if!( |
| 145 | if #[cfg(stm32g4)] { | 145 | if #[cfg(stm32g4)] { |
