time: Update examples, tests, and other code to use new Timer::after_x convenience methods
This commit is contained in:
@@ -7,7 +7,7 @@ use embassy_executor::Spawner;
|
||||
use embassy_nrf::gpio::{Level, Output, OutputDrive};
|
||||
use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex;
|
||||
use embassy_sync::channel::Channel;
|
||||
use embassy_time::{Duration, Timer};
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
enum LedState {
|
||||
@@ -21,9 +21,9 @@ static CHANNEL: Channel<ThreadModeRawMutex, LedState, 1> = Channel::new();
|
||||
async fn my_task() {
|
||||
loop {
|
||||
CHANNEL.send(LedState::On).await;
|
||||
Timer::after(Duration::from_secs(1)).await;
|
||||
Timer::after_secs(1).await;
|
||||
CHANNEL.send(LedState::Off).await;
|
||||
Timer::after(Duration::from_secs(1)).await;
|
||||
Timer::after_secs(1).await;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user