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
This commit is contained in:
parent
666fb94ca3
commit
7354e2ad03
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user