From 58fc64722c65bbdc209ae0fd1700f03702bbcd08 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 14 Jan 2022 22:02:00 +0100 Subject: stm32/gpio: expose all functionality as inherent methods. --- examples/stm32g4/src/bin/blinky.rs | 5 ++--- examples/stm32g4/src/bin/button.rs | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'examples/stm32g4/src') diff --git a/examples/stm32g4/src/bin/blinky.rs b/examples/stm32g4/src/bin/blinky.rs index a43922a63..1dc67f99e 100644 --- a/examples/stm32g4/src/bin/blinky.rs +++ b/examples/stm32g4/src/bin/blinky.rs @@ -8,7 +8,6 @@ use embassy::executor::Spawner; use embassy::time::{Duration, Timer}; use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_stm32::Peripherals; -use embedded_hal::digital::v2::OutputPin; use example_common::*; #[embassy::main] @@ -19,11 +18,11 @@ async fn main(_spawner: Spawner, p: Peripherals) { loop { info!("high"); - unwrap!(led.set_high()); + led.set_high(); Timer::after(Duration::from_millis(300)).await; info!("low"); - unwrap!(led.set_low()); + led.set_low(); Timer::after(Duration::from_millis(300)).await; } } diff --git a/examples/stm32g4/src/bin/button.rs b/examples/stm32g4/src/bin/button.rs index f0a4c8745..8c0d7d4fe 100644 --- a/examples/stm32g4/src/bin/button.rs +++ b/examples/stm32g4/src/bin/button.rs @@ -6,7 +6,6 @@ mod example_common; use cortex_m_rt::entry; use embassy_stm32::gpio::{Input, Pull}; -use embedded_hal::digital::v2::InputPin; use example_common::*; #[entry] @@ -18,7 +17,7 @@ fn main() -> ! { let button = Input::new(p.PC13, Pull::Down); loop { - if unwrap!(button.is_high()) { + if button.is_high() { info!("high"); } else { info!("low"); -- cgit