Skip to content

Commit

Permalink
fix invalid pin error when create busio.SPI
Browse files Browse the repository at this point in the history
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
  • Loading branch information
breakersun committed Jun 14, 2023
1 parent 666fb94 commit 7354e2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ports/mimxrt10xx/common-hal/busio/SPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
// if both MOSI and MISO exist, loop search normally
if ((mosi != NULL) && (miso != NULL)) {
for (uint j = 0; j < mosi_count; j++) {
if ((mcu_spi_sdo_list[i].pin != mosi)
if ((mcu_spi_sdo_list[j].pin != mosi)
|| (mcu_spi_sck_list[i].bank_idx != mcu_spi_sdo_list[j].bank_idx)) {
continue;
}
Expand Down

0 comments on commit 7354e2a

Please sign in to comment.