aboutsummaryrefslogtreecommitdiff
path: root/docs/modules
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 /docs/modules
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 'docs/modules')
-rw-r--r--docs/modules/ROOT/examples/basic/src/main.rs5
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};
17use embedded_hal::digital::v2::OutputPin;
18 17
19#[embassy::task] 18#[embassy::task]
20async fn blinker(mut led: Output<'static, P0_13>, interval: Duration) { 19async 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}