diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-12-19 23:25:02 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-12-20 00:55:18 +0100 |
| commit | 22bc1e4ae17fbc76442d4ee1375cf3a86e0b4757 (patch) | |
| tree | f40189ea47351acc04ad0a616c316cf59ac02ebd /examples/nrf/src/bin/mpsc.rs | |
| parent | fcb43caa36bcf2fb62ddd1c334c46bd6bc876a9e (diff) | |
nrf/gpio: add infallible inherent methods, remove some duplication.
This implements Input and Output using FlexPin, to avoid some code duplication.
Diffstat (limited to 'examples/nrf/src/bin/mpsc.rs')
| -rw-r--r-- | examples/nrf/src/bin/mpsc.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/nrf/src/bin/mpsc.rs b/examples/nrf/src/bin/mpsc.rs index c85b7c282..454fb9541 100644 --- a/examples/nrf/src/bin/mpsc.rs +++ b/examples/nrf/src/bin/mpsc.rs | |||
| @@ -13,7 +13,6 @@ use embassy::time::{Duration, Timer}; | |||
| 13 | use embassy::util::Forever; | 13 | use embassy::util::Forever; |
| 14 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 14 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; |
| 15 | use embassy_nrf::Peripherals; | 15 | use embassy_nrf::Peripherals; |
| 16 | use embedded_hal::digital::v2::OutputPin; | ||
| 17 | 16 | ||
| 18 | enum LedState { | 17 | enum LedState { |
| 19 | On, | 18 | On, |
| @@ -53,8 +52,8 @@ async fn main(spawner: Spawner, p: Peripherals) { | |||
| 53 | Err(TryRecvError::Closed) => break, | 52 | Err(TryRecvError::Closed) => break, |
| 54 | }; | 53 | }; |
| 55 | match maybe_message { | 54 | match maybe_message { |
| 56 | Some(LedState::On) => unwrap!(led.set_high()), | 55 | Some(LedState::On) => led.set_high(), |
| 57 | Some(LedState::Off) => unwrap!(led.set_low()), | 56 | Some(LedState::Off) => led.set_low(), |
| 58 | _ => (), | 57 | _ => (), |
| 59 | } | 58 | } |
| 60 | } | 59 | } |
