Merge pull request #6191 from tannewt/esp_3_wire_spi

Fix 3-wire SPI on ESP
This commit is contained in:
Scott Shawcroft 2022-03-24 14:51:16 -07:00 committed by GitHub
commit ac7977ba75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -205,11 +205,10 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self,
if (len == 0) {
return true;
}
// Other than the read special case, stop transfers that don't have a pin/array match
if (!self->MOSI && (data_out != data_in)) {
if (self->MOSI == NULL && data_out != NULL) {
mp_raise_ValueError(translate("No MOSI Pin"));
}
if (!self->MISO && data_in) {
if (self->MISO == NULL && data_in != NULL) {
mp_raise_ValueError(translate("No MISO Pin"));
}