aboutsummaryrefslogtreecommitdiff
path: root/examples/nrf/src/bin/mpsc.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2021-12-19 23:25:02 +0100
committerDario Nieuwenhuis <[email protected]>2021-12-20 00:55:18 +0100
commit22bc1e4ae17fbc76442d4ee1375cf3a86e0b4757 (patch)
treef40189ea47351acc04ad0a616c316cf59ac02ebd /examples/nrf/src/bin/mpsc.rs
parentfcb43caa36bcf2fb62ddd1c334c46bd6bc876a9e (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.rs5
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};
13use embassy::util::Forever; 13use embassy::util::Forever;
14use embassy_nrf::gpio::{Level, Output, OutputDrive}; 14use embassy_nrf::gpio::{Level, Output, OutputDrive};
15use embassy_nrf::Peripherals; 15use embassy_nrf::Peripherals;
16use embedded_hal::digital::v2::OutputPin;
17 16
18enum LedState { 17enum 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 }