diff options
| author | Maarten de Vries <[email protected]> | 2025-10-30 11:52:53 +0100 |
|---|---|---|
| committer | Maarten de Vries <[email protected]> | 2025-10-30 14:55:30 +0100 |
| commit | 3949a8601f293856df326ccc21252cb5f1518c5c (patch) | |
| tree | 2a320fe5f351a6b3d02717f764913cef29386652 /examples/nrf52840/src/bin | |
| parent | eb096476cc34ff9775801b9b4d2d6f3b1861583e (diff) | |
embassy-nrf: add gpiote::InputChannel::wait_for_high/low()
Also catch GPIOTE events directly when wait() is called, even before
polling the future.
Diffstat (limited to 'examples/nrf52840/src/bin')
| -rw-r--r-- | examples/nrf52840/src/bin/gpiote_channel.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/nrf52840/src/bin/gpiote_channel.rs b/examples/nrf52840/src/bin/gpiote_channel.rs index c7ddc1d8d..e358779b2 100644 --- a/examples/nrf52840/src/bin/gpiote_channel.rs +++ b/examples/nrf52840/src/bin/gpiote_channel.rs | |||
| @@ -12,10 +12,10 @@ async fn main(_spawner: Spawner) { | |||
| 12 | let p = embassy_nrf::init(Default::default()); | 12 | let p = embassy_nrf::init(Default::default()); |
| 13 | info!("Starting!"); | 13 | info!("Starting!"); |
| 14 | 14 | ||
| 15 | let ch1 = InputChannel::new(p.GPIOTE_CH0, p.P0_11, Pull::Up, InputChannelPolarity::HiToLo); | 15 | let mut ch1 = InputChannel::new(p.GPIOTE_CH0, p.P0_11, Pull::Up, InputChannelPolarity::HiToLo); |
| 16 | let ch2 = InputChannel::new(p.GPIOTE_CH1, p.P0_12, Pull::Up, InputChannelPolarity::LoToHi); | 16 | let mut ch2 = InputChannel::new(p.GPIOTE_CH1, p.P0_12, Pull::Up, InputChannelPolarity::LoToHi); |
| 17 | let ch3 = InputChannel::new(p.GPIOTE_CH2, p.P0_24, Pull::Up, InputChannelPolarity::Toggle); | 17 | let mut ch3 = InputChannel::new(p.GPIOTE_CH2, p.P0_24, Pull::Up, InputChannelPolarity::Toggle); |
| 18 | let ch4 = InputChannel::new(p.GPIOTE_CH3, p.P0_25, Pull::Up, InputChannelPolarity::Toggle); | 18 | let mut ch4 = InputChannel::new(p.GPIOTE_CH3, p.P0_25, Pull::Up, InputChannelPolarity::Toggle); |
| 19 | 19 | ||
| 20 | let button1 = async { | 20 | let button1 = async { |
| 21 | loop { | 21 | loop { |
