time: Update examples, tests, and other code to use new Timer::after_x convenience methods
This commit is contained in:
@ -6,21 +6,21 @@
|
||||
use defmt_rtt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_stm32::gpio::{Level, Output, Speed};
|
||||
use embassy_time::{Duration, Timer};
|
||||
use embassy_time::Timer;
|
||||
use panic_reset as _;
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_stm32::init(Default::default());
|
||||
Timer::after(Duration::from_millis(300)).await;
|
||||
Timer::after_millis(300).await;
|
||||
let mut led = Output::new(p.PB14, Level::High, Speed::Low);
|
||||
led.set_high();
|
||||
|
||||
loop {
|
||||
led.set_high();
|
||||
Timer::after(Duration::from_millis(500)).await;
|
||||
Timer::after_millis(500).await;
|
||||
|
||||
led.set_low();
|
||||
Timer::after(Duration::from_millis(500)).await;
|
||||
Timer::after_millis(500).await;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user