aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32f1
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-01-27 00:08:02 +0100
committerDario Nieuwenhuis <[email protected]>2022-01-27 00:08:02 +0100
commit0719b05d63a1d80d3b8ea39a411545a6e8e22ec2 (patch)
tree9abf789ef5213c191433466b0b201edde967eaed /examples/stm32f1
parentd76cd5ceaf5140c48ef97180beae156c0c0e07c8 (diff)
traits: migrate Delay to embedded-hal 1.0+async, remove Rng and Flash.
Diffstat (limited to 'examples/stm32f1')
-rw-r--r--examples/stm32f1/Cargo.toml1
-rw-r--r--examples/stm32f1/src/bin/adc.rs5
2 files changed, 2 insertions, 4 deletions
diff --git a/examples/stm32f1/Cargo.toml b/examples/stm32f1/Cargo.toml
index 44673104e..677e40892 100644
--- a/examples/stm32f1/Cargo.toml
+++ b/examples/stm32f1/Cargo.toml
@@ -7,7 +7,6 @@ resolver = "2"
7 7
8[dependencies] 8[dependencies]
9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } 9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any"] } 10embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any"] }
12 11
13defmt = "0.3" 12defmt = "0.3"
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 @@
6mod example_common; 6mod example_common;
7 7
8use embassy::executor::Spawner; 8use embassy::executor::Spawner;
9use embassy::time::Delay; 9use embassy::time::{Delay, Duration, Timer};
10use embassy_stm32::adc::Adc; 10use embassy_stm32::adc::Adc;
11use embassy_stm32::Peripherals; 11use embassy_stm32::Peripherals;
12use embassy_traits::delay::Delay as _;
13use example_common::*; 12use 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}