diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-01-14 22:02:00 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-01-19 17:59:55 +0100 |
| commit | 58fc64722c65bbdc209ae0fd1700f03702bbcd08 (patch) | |
| tree | 77f9412b47259cd4cf4170b0a257b371398d4f2c /examples/stm32g0/src/bin/button.rs | |
| parent | 52e156b429417bde59d0ea67d11256866f1dcec9 (diff) | |
stm32/gpio: expose all functionality as inherent methods.
Diffstat (limited to 'examples/stm32g0/src/bin/button.rs')
| -rw-r--r-- | examples/stm32g0/src/bin/button.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/stm32g0/src/bin/button.rs b/examples/stm32g0/src/bin/button.rs index 4ca2a43b2..e901c5750 100644 --- a/examples/stm32g0/src/bin/button.rs +++ b/examples/stm32g0/src/bin/button.rs | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | mod example_common; | 6 | mod example_common; |
| 7 | use cortex_m_rt::entry; | 7 | use cortex_m_rt::entry; |
| 8 | use embassy_stm32::gpio::{Input, Pull}; | 8 | use embassy_stm32::gpio::{Input, Pull}; |
| 9 | use embedded_hal::digital::v2::InputPin; | ||
| 10 | use example_common::*; | 9 | use example_common::*; |
| 11 | 10 | ||
| 12 | #[entry] | 11 | #[entry] |
| @@ -18,7 +17,7 @@ fn main() -> ! { | |||
| 18 | let button = Input::new(p.PC13, Pull::Up); | 17 | let button = Input::new(p.PC13, Pull::Up); |
| 19 | 18 | ||
| 20 | loop { | 19 | loop { |
| 21 | if unwrap!(button.is_high()) { | 20 | if button.is_high() { |
| 22 | info!("high"); | 21 | info!("high"); |
| 23 | } else { | 22 | } else { |
| 24 | info!("low"); | 23 | info!("low"); |
