Skip to content

Commit a26040e

Browse files
committed
Use correct port for SPI on 52xxx
The code was ignoring the pin ports and always using port0.
1 parent dcf6c1e commit a26040e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nrf-hal-common/src/spi.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ where
172172
#[cfg(not(feature = "51"))]
173173
fn set_pins(spi: &mut T, pins: Pins) {
174174
if let Some(ref pin) = pins.sck {
175-
spi.psel.sck.write(|w| unsafe { w.bits(pin.pin().into()) });
175+
spi.psel.sck.write(|w| unsafe { w.bits(pin.psel_bits()) });
176176
}
177177
if let Some(ref pin) = pins.mosi {
178-
spi.psel.mosi.write(|w| unsafe { w.bits(pin.pin().into()) });
178+
spi.psel.mosi.write(|w| unsafe { w.bits(pin.psel_bits()) });
179179
}
180180
if let Some(ref pin) = pins.miso {
181-
spi.psel.miso.write(|w| unsafe { w.bits(pin.pin().into()) });
181+
spi.psel.miso.write(|w| unsafe { w.bits(pin.psel_bits()) });
182182
}
183183
}
184184

0 commit comments

Comments
 (0)