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

@ -14,7 +14,7 @@ use embassy_stm32::low_power::{stop_with_rtc, Executor};
use embassy_stm32::rcc::LsConfig;
use embassy_stm32::rtc::{Rtc, RtcConfig};
use embassy_stm32::Config;
use embassy_time::{Duration, Timer};
use embassy_time::Timer;
use static_cell::make_static;
#[entry]
@ -28,7 +28,7 @@ fn main() -> ! {
async fn task_1() {
for _ in 0..9 {
info!("task 1: waiting for 500ms...");
Timer::after(Duration::from_millis(500)).await;
Timer::after_millis(500).await;
}
}
@ -36,7 +36,7 @@ async fn task_1() {
async fn task_2() {
for _ in 0..5 {
info!("task 2: waiting for 1000ms...");
Timer::after(Duration::from_millis(1000)).await;
Timer::after_millis(1000).await;
}
info!("Test OK");