Skip to content

Commit 7354e2a

Browse files
committed
fix invalid pin error when create busio.SPI
on specific SCK/MOSI/MISO pins, the `common_hal_busio_spi_construct` method always skip miso pins which will lead to a `invalid pin` exception when SPI initilized
1 parent 666fb94 commit 7354e2a

File tree

1 file changed

+1
-1
lines changed
  • ports/mimxrt10xx/common-hal/busio

1 file changed

+1
-1
lines changed

ports/mimxrt10xx/common-hal/busio/SPI.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
109109
// if both MOSI and MISO exist, loop search normally
110110
if ((mosi != NULL) && (miso != NULL)) {
111111
for (uint j = 0; j < mosi_count; j++) {
112-
if ((mcu_spi_sdo_list[i].pin != mosi)
112+
if ((mcu_spi_sdo_list[j].pin != mosi)
113113
|| (mcu_spi_sck_list[i].bank_idx != mcu_spi_sdo_list[j].bank_idx)) {
114114
continue;
115115
}

0 commit comments

Comments
 (0)