Skip to content

Commit

Permalink
Merge #397
Browse files Browse the repository at this point in the history
397: Use `is_connected` to determine whether a ctx/rtx was connected to uarte r=jonas-schievink a=hdoordt

`Uarte::free` method uses `bit_is_set` to determine whether a pin was connected to `cts` and `rts`. However, a set bit represents a disconnected pin. Use `is_connected()` instead to do the inversion.

Co-authored-by: Henk Oordt <[email protected]>
  • Loading branch information
bors[bot] and hdoordt authored Sep 15, 2022
2 parents 663008c + 359abb9 commit 612902a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nrf-hal-common/src/uarte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,12 @@ where
Pins {
rxd: unsafe { Pin::from_psel_bits(rxd.bits()) },
txd: unsafe { Pin::from_psel_bits(txd.bits()) },
cts: if cts.connect().bit_is_set() {
cts: if cts.connect().is_connected() {
Some(unsafe { Pin::from_psel_bits(cts.bits()) })
} else {
None
},
rts: if rts.connect().bit_is_set() {
rts: if rts.connect().is_connected() {
Some(unsafe { Pin::from_psel_bits(rts.bits()) })
} else {
None
Expand Down

0 comments on commit 612902a

Please sign in to comment.