diff options
author | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2021-12-19 23:25:02 +0100 |
---|---|---|
committer | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2021-12-20 00:55:18 +0100 |
commit | 22bc1e4ae17fbc76442d4ee1375cf3a86e0b4757 (patch) | |
tree | f40189ea47351acc04ad0a616c316cf59ac02ebd /docs/modules/ROOT | |
parent | fcb43caa36bcf2fb62ddd1c334c46bd6bc876a9e (diff) | |
download | embassy-22bc1e4ae17fbc76442d4ee1375cf3a86e0b4757.zip |
nrf/gpio: add infallible inherent methods, remove some duplication.
This implements Input and Output using FlexPin, to avoid some code duplication.
Diffstat (limited to 'docs/modules/ROOT')
-rw-r--r-- | docs/modules/ROOT/examples/basic/src/main.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/docs/modules/ROOT/examples/basic/src/main.rs b/docs/modules/ROOT/examples/basic/src/main.rs index 2a9b1fac..8394f73b 100644 --- a/docs/modules/ROOT/examples/basic/src/main.rs +++ b/docs/modules/ROOT/examples/basic/src/main.rs @@ -14,14 +14,13 @@ use embassy_nrf::{ peripherals::P0_13, Peripherals, }; -use embedded_hal::digital::v2::OutputPin; #[embassy::task] async fn blinker(mut led: Output<'static, P0_13>, interval: Duration) { loop { - unwrap!(led.set_high()); + led.set_high(); Timer::after(interval).await; - unwrap!(led.set_low()); + led.set_low(); Timer::after(interval).await; } } |