From 98eda74661ef0dc2b11a4b2a4df10c0f50dc5ae6 Mon Sep 17 00:00:00 2001 From: xoviat Date: Tue, 16 Dec 2025 11:02:22 -0600 Subject: allow stm32wb to enter stop2 --- embassy-stm32/src/low_power.rs | 4 ++-- embassy-stm32/src/rcc/mod.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'embassy-stm32/src') diff --git a/embassy-stm32/src/low_power.rs b/embassy-stm32/src/low_power.rs index ce3ee6a03..0cdd7789e 100644 --- a/embassy-stm32/src/low_power.rs +++ b/embassy-stm32/src/low_power.rs @@ -124,9 +124,9 @@ impl Into for StopMode { fn into(self) -> Lpms { match self { StopMode::Stop1 => Lpms::STOP1, - #[cfg(not(any(stm32wb, stm32wba)))] + #[cfg(not(stm32wba))] StopMode::Standby | StopMode::Stop2 => Lpms::STOP2, - #[cfg(any(stm32wb, stm32wba))] + #[cfg(stm32wba)] StopMode::Standby | StopMode::Stop2 => Lpms::STOP1, // TODO: WBA has no STOP2? } } diff --git a/embassy-stm32/src/rcc/mod.rs b/embassy-stm32/src/rcc/mod.rs index d25c922d8..753ee1290 100644 --- a/embassy-stm32/src/rcc/mod.rs +++ b/embassy-stm32/src/rcc/mod.rs @@ -313,7 +313,7 @@ impl RccInfo { #[allow(dead_code)] fn increment_minimum_stop_refcount_with_cs(&self, _cs: CriticalSection) { - #[cfg(all(stm32wlex, feature = "low-power"))] + #[cfg(all(any(stm32wlex, stm32wb), feature = "low-power"))] match self.stop_mode { StopMode::Stop1 | StopMode::Stop2 => increment_stop_refcount(_cs, StopMode::Stop2), _ => {} @@ -334,7 +334,7 @@ impl RccInfo { #[allow(dead_code)] fn decrement_minimum_stop_refcount_with_cs(&self, _cs: CriticalSection) { - #[cfg(all(stm32wlex, feature = "low-power"))] + #[cfg(all(any(stm32wlex, stm32wb), feature = "low-power"))] match self.stop_mode { StopMode::Stop1 | StopMode::Stop2 => decrement_stop_refcount(_cs, StopMode::Stop2), _ => {} -- cgit