diff options
Diffstat (limited to 'examples/stm32wl/src/bin/lorawan.rs')
| -rw-r--r-- | examples/stm32wl/src/bin/lorawan.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/stm32wl/src/bin/lorawan.rs b/examples/stm32wl/src/bin/lorawan.rs index 2db022ea2..35dae71a6 100644 --- a/examples/stm32wl/src/bin/lorawan.rs +++ b/examples/stm32wl/src/bin/lorawan.rs | |||
| @@ -5,13 +5,14 @@ | |||
| 5 | #![feature(generic_associated_types)] | 5 | #![feature(generic_associated_types)] |
| 6 | #![feature(type_alias_impl_trait)] | 6 | #![feature(type_alias_impl_trait)] |
| 7 | 7 | ||
| 8 | use embassy_executor::executor::Spawner; | ||
| 8 | use embassy_lora::stm32wl::*; | 9 | use embassy_lora::stm32wl::*; |
| 9 | use embassy_lora::LoraTimer; | 10 | use embassy_lora::LoraTimer; |
| 10 | use embassy_stm32::dma::NoDma; | 11 | use embassy_stm32::dma::NoDma; |
| 11 | use embassy_stm32::gpio::{Level, Output, Pin, Speed}; | 12 | use embassy_stm32::gpio::{Level, Output, Pin, Speed}; |
| 12 | use embassy_stm32::rng::Rng; | 13 | use embassy_stm32::rng::Rng; |
| 13 | use embassy_stm32::subghz::*; | 14 | use embassy_stm32::subghz::*; |
| 14 | use embassy_stm32::{interrupt, pac, Peripherals}; | 15 | use embassy_stm32::{interrupt, pac}; |
| 15 | use lorawan::default_crypto::DefaultFactory as Crypto; | 16 | use lorawan::default_crypto::DefaultFactory as Crypto; |
| 16 | use lorawan_device::async_device::{region, Device, JoinMode}; | 17 | use lorawan_device::async_device::{region, Device, JoinMode}; |
| 17 | use {defmt_rtt as _, panic_probe as _}; | 18 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -23,8 +24,9 @@ fn config() -> embassy_stm32::Config { | |||
| 23 | config | 24 | config |
| 24 | } | 25 | } |
| 25 | 26 | ||
| 26 | #[embassy_executor::main(config = "config()")] | 27 | #[embassy_executor::main] |
| 27 | async fn main(_spawner: embassy_executor::executor::Spawner, p: Peripherals) { | 28 | async fn main(_spawner: Spawner) { |
| 29 | let p = embassy_stm32::init(config()); | ||
| 28 | unsafe { pac::RCC.ccipr().modify(|w| w.set_rngsel(0b01)) } | 30 | unsafe { pac::RCC.ccipr().modify(|w| w.set_rngsel(0b01)) } |
| 29 | 31 | ||
| 30 | let ctrl1 = Output::new(p.PC3.degrade(), Level::High, Speed::High); | 32 | let ctrl1 = Output::new(p.PC3.degrade(), Level::High, Speed::High); |
