diff options
| author | Dario Nieuwenhuis <[email protected]> | 2020-09-29 04:17:32 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2020-09-29 04:17:32 +0200 |
| commit | c81d626254d4c27e7412d192eb1cb6b6bea2648a (patch) | |
| tree | f858edf14df1873952310796a9f72c6c86b443cd /examples | |
| parent | 32a9b3f4ae6add7d9d0e305b17af53bebd8e0255 (diff) | |
gpiote: take borrow instead of owned pin.
This makes it possible to read the pin while the channel is created.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/src/bin/gpiote.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/src/bin/gpiote.rs b/examples/src/bin/gpiote.rs index b3a391f13..5578062fa 100644 --- a/examples/src/bin/gpiote.rs +++ b/examples/src/bin/gpiote.rs | |||
| @@ -28,7 +28,7 @@ async fn run() { | |||
| 28 | let pin1 = port0.p0_11.into_pullup_input().degrade(); | 28 | let pin1 = port0.p0_11.into_pullup_input().degrade(); |
| 29 | let button1 = async { | 29 | let button1 = async { |
| 30 | let ch = g | 30 | let ch = g |
| 31 | .new_input_channel(pin1, gpiote::EventPolarity::HiToLo) | 31 | .new_input_channel(&pin1, gpiote::EventPolarity::HiToLo) |
| 32 | .dewrap(); | 32 | .dewrap(); |
| 33 | 33 | ||
| 34 | loop { | 34 | loop { |
| @@ -40,7 +40,7 @@ async fn run() { | |||
| 40 | let pin2 = port0.p0_12.into_pullup_input().degrade(); | 40 | let pin2 = port0.p0_12.into_pullup_input().degrade(); |
| 41 | let button2 = async { | 41 | let button2 = async { |
| 42 | let ch = g | 42 | let ch = g |
| 43 | .new_input_channel(pin2, gpiote::EventPolarity::LoToHi) | 43 | .new_input_channel(&pin2, gpiote::EventPolarity::LoToHi) |
| 44 | .dewrap(); | 44 | .dewrap(); |
| 45 | 45 | ||
| 46 | loop { | 46 | loop { |
| @@ -52,7 +52,7 @@ async fn run() { | |||
| 52 | let pin3 = port0.p0_24.into_pullup_input().degrade(); | 52 | let pin3 = port0.p0_24.into_pullup_input().degrade(); |
| 53 | let button3 = async { | 53 | let button3 = async { |
| 54 | let ch = g | 54 | let ch = g |
| 55 | .new_input_channel(pin3, gpiote::EventPolarity::Toggle) | 55 | .new_input_channel(&pin3, gpiote::EventPolarity::Toggle) |
| 56 | .dewrap(); | 56 | .dewrap(); |
| 57 | 57 | ||
| 58 | loop { | 58 | loop { |
| @@ -64,7 +64,7 @@ async fn run() { | |||
| 64 | let pin4 = port0.p0_25.into_pullup_input().degrade(); | 64 | let pin4 = port0.p0_25.into_pullup_input().degrade(); |
| 65 | let button4 = async { | 65 | let button4 = async { |
| 66 | let ch = g | 66 | let ch = g |
| 67 | .new_input_channel(pin4, gpiote::EventPolarity::Toggle) | 67 | .new_input_channel(&pin4, gpiote::EventPolarity::Toggle) |
| 68 | .dewrap(); | 68 | .dewrap(); |
| 69 | 69 | ||
| 70 | loop { | 70 | loop { |
