time: Update examples, tests, and other code to use new Timer::after_x convenience methods

This commit is contained in:
Adam Greig
2023-10-15 00:57:25 +01:00
parent 7559f9e583
commit 0621e957a0
174 changed files with 496 additions and 501 deletions

View File

@ -10,7 +10,7 @@ use defmt::info;
use embassy_executor::Spawner;
use embassy_stm32::exti::ExtiInput;
use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed};
use embassy_time::{Duration, Timer};
use embassy_time::Timer;
use {defmt_rtt as _, panic_probe as _};
static BLINK_MS: AtomicU32 = AtomicU32::new(0);
@ -24,7 +24,7 @@ async fn led_task(led: AnyPin) {
loop {
let del = BLINK_MS.load(Ordering::Relaxed);
info!("Value of del is {}", del);
Timer::after(Duration::from_millis(del.into())).await;
Timer::after_millis(del.into()).await;
info!("LED toggling");
led.toggle();
}