diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-01-19 20:47:07 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-19 20:47:07 +0000 |
| commit | 6b0cb0609b4bfa3e464e4603ce373a9de9886103 (patch) | |
| tree | 70a6590ad9da8c625eb69c21faddb5721bfbcea4 /examples/stm32f1/src | |
| parent | 071b034a5dbece727b28aee6362e36d66bcb763b (diff) | |
| parent | 889d757ab8bcfc10caf0a7d75ffb7733a7e71ed1 (diff) | |
Merge #581
581: stm32: expose all functionality as inherent methods. r=Dirbaio a=Dirbaio
This is the previous step to implementing both the embedded-hal 0.2 and embedded-hal 1.0 + embedded-hal-async traits.
The equivalent in nrf was done in #552
- Removes need for `unwrap` in gpio.
- Removes need for `use embedded_hal::whatever` in all cases.
Co-authored-by: Dario Nieuwenhuis <[email protected]>
Diffstat (limited to 'examples/stm32f1/src')
| -rw-r--r-- | examples/stm32f1/src/bin/blinky.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/stm32f1/src/bin/blinky.rs b/examples/stm32f1/src/bin/blinky.rs index 1e4f2deec..0d9537453 100644 --- a/examples/stm32f1/src/bin/blinky.rs +++ b/examples/stm32f1/src/bin/blinky.rs | |||
| @@ -8,7 +8,6 @@ use embassy::executor::Spawner; | |||
| 8 | use embassy::time::{Duration, Timer}; | 8 | use embassy::time::{Duration, Timer}; |
| 9 | use embassy_stm32::gpio::{Level, Output, Speed}; | 9 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 10 | use embassy_stm32::Peripherals; | 10 | use embassy_stm32::Peripherals; |
| 11 | use embedded_hal::digital::v2::OutputPin; | ||
| 12 | use example_common::*; | 11 | use example_common::*; |
| 13 | 12 | ||
| 14 | #[embassy::main] | 13 | #[embassy::main] |
| @@ -19,11 +18,11 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 19 | 18 | ||
| 20 | loop { | 19 | loop { |
| 21 | info!("high"); | 20 | info!("high"); |
| 22 | unwrap!(led.set_high()); | 21 | led.set_high(); |
| 23 | Timer::after(Duration::from_millis(300)).await; | 22 | Timer::after(Duration::from_millis(300)).await; |
| 24 | 23 | ||
| 25 | info!("low"); | 24 | info!("low"); |
| 26 | unwrap!(led.set_low()); | 25 | led.set_low(); |
| 27 | Timer::after(Duration::from_millis(300)).await; | 26 | Timer::after(Duration::from_millis(300)).await; |
| 28 | } | 27 | } |
| 29 | } | 28 | } |
