Skip to content

Commit

Permalink
Fix 3-wire SPI on ESP
Browse files Browse the repository at this point in the history
Simplifying the checks fixed it.

Fixes #6141
  • Loading branch information
tannewt committed Mar 23, 2022
1 parent 8ebab76 commit 380a708
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ports/espressif/common-hal/busio/SPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down

0 comments on commit 380a708

Please sign in to comment.