diff options
| author | Tobias Naumann <[email protected]> | 2024-07-26 14:25:10 +0200 |
|---|---|---|
| committer | Tobias Naumann <[email protected]> | 2024-07-26 14:25:10 +0200 |
| commit | 60aa9c15a8a246d1d099beec8a1e3cbf08f52a8f (patch) | |
| tree | f5553b5da9d3a86b5be41b15e541d0231459b444 /embassy-stm32/src/low_power.rs | |
| parent | b88dc137e766d89eca5472bfa6f3bb78cfd1f7e0 (diff) | |
Implement low-power feature for stm32l4 MCUs
Diffstat (limited to 'embassy-stm32/src/low_power.rs')
| -rw-r--r-- | embassy-stm32/src/low_power.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-stm32/src/low_power.rs b/embassy-stm32/src/low_power.rs index 604bdf416..f3e4c6994 100644 --- a/embassy-stm32/src/low_power.rs +++ b/embassy-stm32/src/low_power.rs | |||
| @@ -109,10 +109,10 @@ pub enum StopMode { | |||
| 109 | Stop2, | 109 | Stop2, |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | #[cfg(stm32l5)] | 112 | #[cfg(any(stm32l4, stm32l5))] |
| 113 | use stm32_metapac::pwr::vals::Lpms; | 113 | use stm32_metapac::pwr::vals::Lpms; |
| 114 | 114 | ||
| 115 | #[cfg(stm32l5)] | 115 | #[cfg(any(stm32l4, stm32l5))] |
| 116 | impl Into<Lpms> for StopMode { | 116 | impl Into<Lpms> for StopMode { |
| 117 | fn into(self) -> Lpms { | 117 | fn into(self) -> Lpms { |
| 118 | match self { | 118 | match self { |
| @@ -181,7 +181,7 @@ impl Executor { | |||
| 181 | 181 | ||
| 182 | #[allow(unused_variables)] | 182 | #[allow(unused_variables)] |
| 183 | fn configure_stop(&mut self, stop_mode: StopMode) { | 183 | fn configure_stop(&mut self, stop_mode: StopMode) { |
| 184 | #[cfg(stm32l5)] | 184 | #[cfg(any(stm32l4, stm32l5))] |
| 185 | crate::pac::PWR.cr1().modify(|m| m.set_lpms(stop_mode.into())); | 185 | crate::pac::PWR.cr1().modify(|m| m.set_lpms(stop_mode.into())); |
| 186 | #[cfg(stm32h5)] | 186 | #[cfg(stm32h5)] |
| 187 | crate::pac::PWR.pmcr().modify(|v| { | 187 | crate::pac::PWR.pmcr().modify(|v| { |
