diff options
| author | liebman <[email protected]> | 2025-12-13 10:01:57 -0800 |
|---|---|---|
| committer | liebman <[email protected]> | 2025-12-13 10:01:57 -0800 |
| commit | 67a67c7d3cd9a5e2b917b108bfdebc858a2f79a3 (patch) | |
| tree | fe24d4fdd9804cecf1e0a99e88d66b629f029a5b /examples/stm32wle5/src/bin/adc.rs | |
| parent | 803b809e5dbe7651b7171917e02289b067e90dad (diff) | |
stm32: update stm32wle5 low powe examples
Diffstat (limited to 'examples/stm32wle5/src/bin/adc.rs')
| -rw-r--r-- | examples/stm32wle5/src/bin/adc.rs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/examples/stm32wle5/src/bin/adc.rs b/examples/stm32wle5/src/bin/adc.rs index ea91fb063..8cc84ccdf 100644 --- a/examples/stm32wle5/src/bin/adc.rs +++ b/examples/stm32wle5/src/bin/adc.rs | |||
| @@ -34,24 +34,6 @@ async fn async_main(_spawner: Spawner) { | |||
| 34 | // Initialize STM32WL peripherals (use default config like wio-e5-async example) | 34 | // Initialize STM32WL peripherals (use default config like wio-e5-async example) |
| 35 | let p = embassy_stm32::init(config); | 35 | let p = embassy_stm32::init(config); |
| 36 | 36 | ||
| 37 | // start with all GPIOs as analog to reduce power consumption | ||
| 38 | for r in [ | ||
| 39 | embassy_stm32::pac::GPIOA, | ||
| 40 | embassy_stm32::pac::GPIOB, | ||
| 41 | embassy_stm32::pac::GPIOC, | ||
| 42 | embassy_stm32::pac::GPIOH, | ||
| 43 | ] { | ||
| 44 | r.moder().modify(|w| { | ||
| 45 | for i in 0..16 { | ||
| 46 | // don't reset these if probe-rs should stay connected! | ||
| 47 | #[cfg(feature = "defmt-rtt")] | ||
| 48 | if config.enable_debug_during_sleep && r == embassy_stm32::pac::GPIOA && [13, 14].contains(&i) { | ||
| 49 | continue; | ||
| 50 | } | ||
| 51 | w.set_moder(i, embassy_stm32::pac::gpio::vals::Moder::ANALOG); | ||
| 52 | } | ||
| 53 | }); | ||
| 54 | } | ||
| 55 | #[cfg(feature = "defmt-serial")] | 37 | #[cfg(feature = "defmt-serial")] |
| 56 | { | 38 | { |
| 57 | use embassy_stm32::mode::Blocking; | 39 | use embassy_stm32::mode::Blocking; |
