From 488d06c0e9da673f770b41d8f79bf26227dc6d53 Mon Sep 17 00:00:00 2001 From: xoviat Date: Tue, 4 Nov 2025 12:26:37 -0600 Subject: stm32/stop: move stop_with_rtc into init --- examples/stm32h5/src/bin/stop.rs | 5 ----- examples/stm32l5/src/bin/stop.rs | 5 ----- examples/stm32wle5/src/bin/adc.rs | 6 ------ examples/stm32wle5/src/bin/blinky.rs | 6 ------ examples/stm32wle5/src/bin/button_exti.rs | 6 ------ examples/stm32wle5/src/bin/i2c.rs | 6 ------ 6 files changed, 34 deletions(-) (limited to 'examples') diff --git a/examples/stm32h5/src/bin/stop.rs b/examples/stm32h5/src/bin/stop.rs index 2026d8f99..caebc9daf 100644 --- a/examples/stm32h5/src/bin/stop.rs +++ b/examples/stm32h5/src/bin/stop.rs @@ -9,7 +9,6 @@ use embassy_executor::Spawner; use embassy_stm32::gpio::{AnyPin, Level, Output, Speed}; use embassy_stm32::low_power::Executor; use embassy_stm32::rcc::{HSIPrescaler, LsConfig}; -use embassy_stm32::rtc::{Rtc, RtcConfig}; use embassy_stm32::{Config, Peri}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; @@ -36,10 +35,6 @@ async fn async_main(spawner: Spawner) { // config.enable_debug_during_sleep = false; let p = embassy_stm32::init(config); - // give the RTC to the executor... - let rtc = Rtc::new(p.RTC, RtcConfig::default()); - embassy_stm32::low_power::stop_with_rtc(rtc); - spawner.spawn(unwrap!(blinky(p.PB4.into()))); spawner.spawn(unwrap!(timeout())); } diff --git a/examples/stm32l5/src/bin/stop.rs b/examples/stm32l5/src/bin/stop.rs index 7662dbfa8..3d119f90f 100644 --- a/examples/stm32l5/src/bin/stop.rs +++ b/examples/stm32l5/src/bin/stop.rs @@ -6,7 +6,6 @@ use embassy_executor::Spawner; use embassy_stm32::gpio::{AnyPin, Level, Output, Speed}; use embassy_stm32::low_power::Executor; use embassy_stm32::rcc::LsConfig; -use embassy_stm32::rtc::{Rtc, RtcConfig}; use embassy_stm32::{Config, Peri}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; @@ -27,10 +26,6 @@ async fn async_main(spawner: Spawner) { // config.enable_debug_during_sleep = false; let p = embassy_stm32::init(config); - // give the RTC to the executor... - let rtc = Rtc::new(p.RTC, RtcConfig::default()); - embassy_stm32::low_power::stop_with_rtc(rtc); - spawner.spawn(unwrap!(blinky(p.PC7.into()))); spawner.spawn(unwrap!(timeout())); } diff --git a/examples/stm32wle5/src/bin/adc.rs b/examples/stm32wle5/src/bin/adc.rs index ff1a5fa16..8b830a1e6 100644 --- a/examples/stm32wle5/src/bin/adc.rs +++ b/examples/stm32wle5/src/bin/adc.rs @@ -7,7 +7,6 @@ use defmt_rtt as _; use embassy_executor::Spawner; use embassy_stm32::adc::{Adc, SampleTime}; use embassy_stm32::low_power::Executor; -use embassy_stm32::rtc::{Rtc, RtcConfig}; use embassy_time::Timer; use panic_probe as _; use static_cell::StaticCell; @@ -71,11 +70,6 @@ async fn async_main(_spawner: Spawner) { defmt_serial::defmt_serial(SERIAL.init(uart)); } - // give the RTC to the low_power executor... - let rtc_config = RtcConfig::default(); - let rtc = Rtc::new(p.RTC, rtc_config); - embassy_stm32::low_power::stop_with_rtc(rtc); - info!("Hello World!"); let mut adc = Adc::new(p.ADC1); diff --git a/examples/stm32wle5/src/bin/blinky.rs b/examples/stm32wle5/src/bin/blinky.rs index 1191a1157..b2745fdaf 100644 --- a/examples/stm32wle5/src/bin/blinky.rs +++ b/examples/stm32wle5/src/bin/blinky.rs @@ -7,7 +7,6 @@ use defmt_rtt as _; use embassy_executor::Spawner; use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_stm32::low_power::Executor; -use embassy_stm32::rtc::{Rtc, RtcConfig}; use embassy_time::Timer; use panic_probe as _; use static_cell::StaticCell; @@ -69,11 +68,6 @@ async fn async_main(_spawner: Spawner) { defmt_serial::defmt_serial(SERIAL.init(uart)); } - // give the RTC to the low_power executor... - let rtc_config = RtcConfig::default(); - let rtc = Rtc::new(p.RTC, rtc_config); - embassy_stm32::low_power::stop_with_rtc(rtc); - info!("Hello World!"); let mut led = Output::new(p.PB5, Level::High, Speed::Low); diff --git a/examples/stm32wle5/src/bin/button_exti.rs b/examples/stm32wle5/src/bin/button_exti.rs index f07f9724d..db1bff0be 100644 --- a/examples/stm32wle5/src/bin/button_exti.rs +++ b/examples/stm32wle5/src/bin/button_exti.rs @@ -8,7 +8,6 @@ use embassy_executor::Spawner; use embassy_stm32::exti::ExtiInput; use embassy_stm32::gpio::Pull; use embassy_stm32::low_power::Executor; -use embassy_stm32::rtc::{Rtc, RtcConfig}; use panic_probe as _; use static_cell::StaticCell; @@ -71,11 +70,6 @@ async fn async_main(_spawner: Spawner) { defmt_serial::defmt_serial(SERIAL.init(uart)); } - // give the RTC to the low_power executor... - let rtc_config = RtcConfig::default(); - let rtc = Rtc::new(p.RTC, rtc_config); - embassy_stm32::low_power::stop_with_rtc(rtc); - info!("Hello World!"); let mut button = ExtiInput::new(p.PA0, p.EXTI0, Pull::Up); diff --git a/examples/stm32wle5/src/bin/i2c.rs b/examples/stm32wle5/src/bin/i2c.rs index af07f911e..c31c673c9 100644 --- a/examples/stm32wle5/src/bin/i2c.rs +++ b/examples/stm32wle5/src/bin/i2c.rs @@ -7,7 +7,6 @@ use defmt_rtt as _; use embassy_executor::Spawner; use embassy_stm32::i2c::I2c; use embassy_stm32::low_power::Executor; -use embassy_stm32::rtc::{Rtc, RtcConfig}; use embassy_stm32::time::Hertz; use embassy_stm32::{bind_interrupts, i2c, peripherals}; use embassy_time::{Duration, Timer}; @@ -78,11 +77,6 @@ async fn async_main(_spawner: Spawner) { defmt_serial::defmt_serial(SERIAL.init(uart)); } - // give the RTC to the low_power executor... - let rtc_config = RtcConfig::default(); - let rtc = Rtc::new(p.RTC, rtc_config); - embassy_stm32::low_power::stop_with_rtc(rtc); - info!("Hello World!"); let en3v3 = embassy_stm32::gpio::Output::new( p.PA9, -- cgit