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

@ -12,7 +12,7 @@ use embassy_executor::Spawner;
use embassy_stm32::adc::Adc;
use embassy_stm32::dac::{DacCh1, DacChannel, Value};
use embassy_stm32::dma::NoDma;
use embassy_time::{Delay, Duration, Timer};
use embassy_time::{Delay, Timer};
use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::main]
@ -38,7 +38,7 @@ async fn main(_spawner: Spawner) {
unwrap!(dac.set(Value::Bit8(0)));
// Now wait a little to obtain a stable value
Timer::after(Duration::from_millis(30)).await;
Timer::after_millis(30).await;
let offset = adc.read(&mut unsafe { embassy_stm32::Peripherals::steal() }.PA4);
for v in 0..=255 {
@ -47,7 +47,7 @@ async fn main(_spawner: Spawner) {
unwrap!(dac.set(Value::Bit8(dac_output_val)));
// Now wait a little to obtain a stable value
Timer::after(Duration::from_millis(30)).await;
Timer::after_millis(30).await;
// Need to steal the peripherals here because PA4 is obviously in use already
let measured = adc.read(&mut unsafe { embassy_stm32::Peripherals::steal() }.PA4);