Fix 3-wire SPI on ESP

Simplifying the checks fixed it.

Fixes #6141
This commit is contained in:
Scott Shawcroft 2022-03-23 14:53:46 -07:00
parent 8ebab7625e
commit 380a7087d4
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA

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"));
}