diff options
| author | Dario Nieuwenhuis <[email protected]> | 2020-12-29 01:53:17 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2020-12-29 01:53:17 +0100 |
| commit | af5454fbfec6232074c79ef571b2135dc7253d45 (patch) | |
| tree | 2dd99c7e6ca0ae1b0c7634d0bb983c862dcbdad5 /examples/src/bin/gpiote.rs | |
| parent | 4b8d8ba87ee26173b0a7743c606c76df2d171790 (diff) | |
Update drivers to owned irqs.
Diffstat (limited to 'examples/src/bin/gpiote.rs')
| -rw-r--r-- | examples/src/bin/gpiote.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/src/bin/gpiote.rs b/examples/src/bin/gpiote.rs index edc3f5ef1..afa1b85d5 100644 --- a/examples/src/bin/gpiote.rs +++ b/examples/src/bin/gpiote.rs | |||
| @@ -7,18 +7,20 @@ mod example_common; | |||
| 7 | use example_common::*; | 7 | use example_common::*; |
| 8 | 8 | ||
| 9 | use cortex_m_rt::entry; | 9 | use cortex_m_rt::entry; |
| 10 | use defmt::panic; | ||
| 10 | use nrf52840_hal::gpio; | 11 | use nrf52840_hal::gpio; |
| 11 | 12 | ||
| 12 | use embassy::executor::{task, Executor}; | 13 | use embassy::executor::{task, Executor}; |
| 13 | use embassy::util::Forever; | 14 | use embassy::util::Forever; |
| 14 | use embassy_nrf::gpiote; | 15 | use embassy_nrf::gpiote; |
| 16 | use embassy_nrf::interrupt; | ||
| 15 | 17 | ||
| 16 | #[task] | 18 | #[task] |
| 17 | async fn run() { | 19 | async fn run() { |
| 18 | let p = unwrap!(embassy_nrf::pac::Peripherals::take()); | 20 | let p = unwrap!(embassy_nrf::pac::Peripherals::take()); |
| 19 | let port0 = gpio::p0::Parts::new(p.P0); | 21 | let port0 = gpio::p0::Parts::new(p.P0); |
| 20 | 22 | ||
| 21 | let g = gpiote::Gpiote::new(p.GPIOTE); | 23 | let g = gpiote::Gpiote::new(p.GPIOTE, interrupt::take!(GPIOTE)); |
| 22 | 24 | ||
| 23 | info!("Starting!"); | 25 | info!("Starting!"); |
| 24 | 26 | ||
