From 9b01eed1956421dd7c0ad644f77e14a05ab92923 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Fri, 10 Dec 2021 12:32:20 +0100 Subject: [PATCH] Revert blinky changes for now --- examples/nrf/src/bin/blinky.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/examples/nrf/src/bin/blinky.rs b/examples/nrf/src/bin/blinky.rs index 3a1440684..a12fe58ff 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; + } }