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 /docs | |
| 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 'docs')
| -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 2a9b1facc..8394f73b7 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::{ | |||
| 14 | peripherals::P0_13, | 14 | peripherals::P0_13, |
| 15 | Peripherals, | 15 | Peripherals, |
| 16 | }; | 16 | }; |
| 17 | use embedded_hal::digital::v2::OutputPin; | ||
| 18 | 17 | ||
| 19 | #[embassy::task] | 18 | #[embassy::task] |
| 20 | async fn blinker(mut led: Output<'static, P0_13>, interval: Duration) { | 19 | async fn blinker(mut led: Output<'static, P0_13>, interval: Duration) { |
| 21 | loop { | 20 | loop { |
| 22 | unwrap!(led.set_high()); | 21 | led.set_high(); |
| 23 | Timer::after(interval).await; | 22 | Timer::after(interval).await; |
| 24 | unwrap!(led.set_low()); | 23 | led.set_low(); |
| 25 | Timer::after(interval).await; | 24 | Timer::after(interval).await; |
| 26 | } | 25 | } |
| 27 | } | 26 | } |
