traits: migrate Delay to embedded-hal 1.0+async, remove Rng and Flash.

This commit is contained in:
Dario Nieuwenhuis
2022-01-27 00:08:02 +01:00
parent d76cd5ceaf
commit 0719b05d63
32 changed files with 145 additions and 304 deletions

View File

@ -7,7 +7,6 @@ resolver = "2"
[dependencies]
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any"] }
defmt = "0.3"

View File

@ -6,10 +6,9 @@
mod example_common;
use embassy::executor::Spawner;
use embassy::time::Delay;
use embassy::time::{Delay, Duration, Timer};
use embassy_stm32::adc::Adc;
use embassy_stm32::Peripherals;
use embassy_traits::delay::Delay as _;
use example_common::*;
#[embassy::main]
@ -24,6 +23,6 @@ async fn main(_spawner: Spawner, p: Peripherals) {
loop {
let v = adc.read(&mut pin);
info!("--> {} - {} mV", v, adc.to_millivolts(v));
Delay.delay_ms(100).await;
Timer::after(Duration::from_millis(100)).await;
}
}