diff options
Diffstat (limited to 'examples/stm32wl')
| -rw-r--r-- | examples/stm32wl/src/bin/blinky.rs | 6 | ||||
| -rw-r--r-- | examples/stm32wl/src/bin/lora_p2p_receive.rs | 6 | ||||
| -rw-r--r-- | examples/stm32wl/src/bin/rtc.rs | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/examples/stm32wl/src/bin/blinky.rs b/examples/stm32wl/src/bin/blinky.rs index 6af5099ce..5bd5745f0 100644 --- a/examples/stm32wl/src/bin/blinky.rs +++ b/examples/stm32wl/src/bin/blinky.rs | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 8 | use embassy_time::{Duration, Timer}; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy_executor::main] | 11 | #[embassy_executor::main] |
| @@ -18,10 +18,10 @@ async fn main(_spawner: Spawner) { | |||
| 18 | loop { | 18 | loop { |
| 19 | info!("high"); | 19 | info!("high"); |
| 20 | led.set_high(); | 20 | led.set_high(); |
| 21 | Timer::after(Duration::from_millis(500)).await; | 21 | Timer::after_millis(500).await; |
| 22 | 22 | ||
| 23 | info!("low"); | 23 | info!("low"); |
| 24 | led.set_low(); | 24 | led.set_low(); |
| 25 | Timer::after(Duration::from_millis(500)).await; | 25 | Timer::after_millis(500).await; |
| 26 | } | 26 | } |
| 27 | } | 27 | } |
diff --git a/examples/stm32wl/src/bin/lora_p2p_receive.rs b/examples/stm32wl/src/bin/lora_p2p_receive.rs index 19b0d8531..be33f39c1 100644 --- a/examples/stm32wl/src/bin/lora_p2p_receive.rs +++ b/examples/stm32wl/src/bin/lora_p2p_receive.rs | |||
| @@ -11,7 +11,7 @@ use embassy_lora::iv::{InterruptHandler, Stm32wlInterfaceVariant}; | |||
| 11 | use embassy_stm32::bind_interrupts; | 11 | use embassy_stm32::bind_interrupts; |
| 12 | use embassy_stm32::gpio::{Level, Output, Pin, Speed}; | 12 | use embassy_stm32::gpio::{Level, Output, Pin, Speed}; |
| 13 | use embassy_stm32::spi::Spi; | 13 | use embassy_stm32::spi::Spi; |
| 14 | use embassy_time::{Delay, Duration, Timer}; | 14 | use embassy_time::{Delay, Timer}; |
| 15 | use lora_phy::mod_params::*; | 15 | use lora_phy::mod_params::*; |
| 16 | use lora_phy::sx1261_2::SX1261_2; | 16 | use lora_phy::sx1261_2::SX1261_2; |
| 17 | use lora_phy::LoRa; | 17 | use lora_phy::LoRa; |
| @@ -51,7 +51,7 @@ async fn main(_spawner: Spawner) { | |||
| 51 | let mut start_indicator = Output::new(p.PB15, Level::Low, Speed::Low); | 51 | let mut start_indicator = Output::new(p.PB15, Level::Low, Speed::Low); |
| 52 | 52 | ||
| 53 | start_indicator.set_high(); | 53 | start_indicator.set_high(); |
| 54 | Timer::after(Duration::from_secs(5)).await; | 54 | Timer::after_secs(5).await; |
| 55 | start_indicator.set_low(); | 55 | start_indicator.set_low(); |
| 56 | 56 | ||
| 57 | let mut receiving_buffer = [00u8; 100]; | 57 | let mut receiving_buffer = [00u8; 100]; |
| @@ -103,7 +103,7 @@ async fn main(_spawner: Spawner) { | |||
| 103 | { | 103 | { |
| 104 | info!("rx successful"); | 104 | info!("rx successful"); |
| 105 | debug_indicator.set_high(); | 105 | debug_indicator.set_high(); |
| 106 | Timer::after(Duration::from_secs(5)).await; | 106 | Timer::after_secs(5).await; |
| 107 | debug_indicator.set_low(); | 107 | debug_indicator.set_low(); |
| 108 | } else { | 108 | } else { |
| 109 | info!("rx unknown packet"); | 109 | info!("rx unknown packet"); |
diff --git a/examples/stm32wl/src/bin/rtc.rs b/examples/stm32wl/src/bin/rtc.rs index a6bb28013..9ebb05f22 100644 --- a/examples/stm32wl/src/bin/rtc.rs +++ b/examples/stm32wl/src/bin/rtc.rs | |||
| @@ -8,7 +8,7 @@ use embassy_executor::Spawner; | |||
| 8 | use embassy_stm32::rcc::{ClockSrc, LsConfig}; | 8 | use embassy_stm32::rcc::{ClockSrc, LsConfig}; |
| 9 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | 9 | use embassy_stm32::rtc::{Rtc, RtcConfig}; |
| 10 | use embassy_stm32::Config; | 10 | use embassy_stm32::Config; |
| 11 | use embassy_time::{Duration, Timer}; | 11 | use embassy_time::Timer; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | #[embassy_executor::main] | 14 | #[embassy_executor::main] |
| @@ -32,7 +32,7 @@ async fn main(_spawner: Spawner) { | |||
| 32 | rtc.set_datetime(now.into()).expect("datetime not set"); | 32 | rtc.set_datetime(now.into()).expect("datetime not set"); |
| 33 | 33 | ||
| 34 | // In reality the delay would be much longer | 34 | // In reality the delay would be much longer |
| 35 | Timer::after(Duration::from_millis(20000)).await; | 35 | Timer::after_millis(20000).await; |
| 36 | 36 | ||
| 37 | let then: NaiveDateTime = rtc.now().unwrap().into(); | 37 | let then: NaiveDateTime = rtc.now().unwrap().into(); |
| 38 | info!("Got RTC! {:?}", then.timestamp()); | 38 | info!("Got RTC! {:?}", then.timestamp()); |
