diff --git a/ports/espressif/common-hal/busio/SPI.c b/ports/espressif/common-hal/busio/SPI.c index 659aa52f5b..68d4e1d72b 100644 --- a/ports/espressif/common-hal/busio/SPI.c +++ b/ports/espressif/common-hal/busio/SPI.c @@ -262,10 +262,9 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, for (int i = 0; i < cur_trans; i++) { spi_device_queue_trans(spi_handle[self->host_id], &transactions[i], portMAX_DELAY); + RUN_BACKGROUND_TASKS; } - RUN_BACKGROUND_TASKS; - spi_transaction_t *rtrans; for (int x = 0; x < cur_trans; x++) { spi_device_get_trans_result(spi_handle[self->host_id], &rtrans, portMAX_DELAY);