Skip to content

Commit d7f0784

Browse files
Merge pull request #217 from trembel/master
Adding Port on GPIOTE Configuration
2 parents 4f41e48 + fc9aa01 commit d7f0784

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- Refuse to build nRF52+ HALs for thumbv6m targets ([#203]).
1818
- Refuse to build `nrf52810-hal` for hard-float targets, and `nrf51-hal` for thumbv7+ targets
1919
([#206]).
20+
- GPIOTE Port 1 and 0 differentiation for nRF52833 and nRF52840 ([#217])
2021

2122
### Breaking Changes
2223

@@ -32,6 +33,7 @@
3233
[#203]: https://github.com/nrf-rs/nrf-hal/pull/203
3334
[#190]: https://github.com/nrf-rs/nrf-hal/pull/190
3435
[#206]: https://github.com/nrf-rs/nrf-hal/pull/206
36+
[#217]: https://github.com/nrf-rs/nrf-hal/pull/217
3537

3638
## [0.11.1]
3739

nrf-hal-common/src/gpiote.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,15 @@ fn config_channel_event_pin<P: GpioteInputPin>(
257257
EventPolarity::None => w.mode().event().polarity().none(),
258258
EventPolarity::Toggle => w.mode().event().polarity().toggle(),
259259
};
260+
261+
#[cfg(any(feature = "52833", feature = "52840"))]
262+
{
263+
match pin.port() {
264+
Port::Port0 => w.port().clear_bit(),
265+
Port::Port1 => w.port().set_bit(),
266+
};
267+
}
268+
260269
unsafe { w.psel().bits(pin.pin()) }
261270
});
262271
}

0 commit comments

Comments
 (0)