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

@ -13,7 +13,7 @@ use embassy_nrf::gpio::{Level, Output, OutputDrive};
use embassy_nrf::ppi::{Event, Ppi, Task};
use embassy_nrf::uarte::Uarte;
use embassy_nrf::{bind_interrupts, pac, peripherals, uarte};
use embassy_time::{Duration, Timer};
use embassy_time::Timer;
use {defmt_rtt as _, panic_probe as _};
bind_interrupts!(struct Irqs {
@ -50,7 +50,7 @@ async fn main(_spawner: Spawner) {
info!("uarte initialized!");
// uarte needs some quiet time to start rxing properly.
Timer::after(Duration::from_millis(10)).await;
Timer::after_millis(10).await;
// Tx spam in a loop.
const NSPAM: usize = 17;

View File

@ -5,7 +5,7 @@ teleprobe_meta::target!(b"nrf52840-dk");
use defmt::{assert, info};
use embassy_executor::Spawner;
use embassy_time::{Duration, Instant, Timer};
use embassy_time::{Instant, Timer};
use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::main]
@ -14,7 +14,7 @@ async fn main(_spawner: Spawner) {
info!("Hello World!");
let start = Instant::now();
Timer::after(Duration::from_millis(100)).await;
Timer::after_millis(100).await;
let end = Instant::now();
let ms = (end - start).as_millis();
info!("slept for {} ms", ms);