diff --git a/examples/nrf/src/bin/blinky.rs b/examples/nrf/src/bin/blinky.rs index 3a144068..a12fe58f 100644 --- a/examples/nrf/src/bin/blinky.rs +++ b/examples/nrf/src/bin/blinky.rs @@ -8,21 +8,18 @@ mod example_common; use defmt::unwrap; use embassy::executor::Spawner; use embassy::time::{Duration, Timer}; -use embassy_nrf::{Peripherals, peripherals::P0_13, gpio::{Level, Output, OutputDrive}; +use embassy_nrf::gpio::{Level, Output, OutputDrive}; +use embassy_nrf::Peripherals; use embedded_hal::digital::v2::OutputPin; -#[embassh::task] -async fn blinker(led: Output<'static, P0_13>, interval: Duration) { - loop { - unwrap!(led.set_high()); - Timer::after(interval).await; - unwrap!(led.set_low()); - Timer::after(interval).await; - } -} - #[embassy::main] async fn main(_spawner: Spawner, p: Peripherals) { let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); - unwrap!(spawner.spawn(blinker(led, Duration::from_millis(300)))); + + loop { + unwrap!(led.set_high()); + Timer::after(Duration::from_millis(300)).await; + unwrap!(led.set_low()); + Timer::after(Duration::from_millis(300)).await; + } }