diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-01-27 00:08:02 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-01-27 00:08:02 +0100 |
| commit | 0719b05d63a1d80d3b8ea39a411545a6e8e22ec2 (patch) | |
| tree | 9abf789ef5213c191433466b0b201edde967eaed /examples/stm32f1/src | |
| parent | d76cd5ceaf5140c48ef97180beae156c0c0e07c8 (diff) | |
traits: migrate Delay to embedded-hal 1.0+async, remove Rng and Flash.
Diffstat (limited to 'examples/stm32f1/src')
| -rw-r--r-- | examples/stm32f1/src/bin/adc.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/stm32f1/src/bin/adc.rs b/examples/stm32f1/src/bin/adc.rs index de2214630..d24f3f5cb 100644 --- a/examples/stm32f1/src/bin/adc.rs +++ b/examples/stm32f1/src/bin/adc.rs | |||
| @@ -6,10 +6,9 @@ | |||
| 6 | mod example_common; | 6 | mod example_common; |
| 7 | 7 | ||
| 8 | use embassy::executor::Spawner; | 8 | use embassy::executor::Spawner; |
| 9 | use embassy::time::Delay; | 9 | use embassy::time::{Delay, Duration, Timer}; |
| 10 | use embassy_stm32::adc::Adc; | 10 | use embassy_stm32::adc::Adc; |
| 11 | use embassy_stm32::Peripherals; | 11 | use embassy_stm32::Peripherals; |
| 12 | use embassy_traits::delay::Delay as _; | ||
| 13 | use example_common::*; | 12 | use example_common::*; |
| 14 | 13 | ||
| 15 | #[embassy::main] | 14 | #[embassy::main] |
| @@ -24,6 +23,6 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 24 | loop { | 23 | loop { |
| 25 | let v = adc.read(&mut pin); | 24 | let v = adc.read(&mut pin); |
| 26 | info!("--> {} - {} mV", v, adc.to_millivolts(v)); | 25 | info!("--> {} - {} mV", v, adc.to_millivolts(v)); |
| 27 | Delay.delay_ms(100).await; | 26 | Timer::after(Duration::from_millis(100)).await; |
| 28 | } | 27 | } |
| 29 | } | 28 | } |
