Skip to content

Commit badaf3e

Browse files
committed
esp8266/machine_hspi: After an SPI write wait for last byte to transfer.
Because otherwise the function can return with data still waiting to be clocked out, and CS might then be disabled before the SPI transaction is complete. Fixes issue adafruit#3487.
1 parent bb516af commit badaf3e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

ports/esp8266/machine_hspi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ STATIC void machine_hspi_transfer(mp_obj_base_t *self_in, size_t len, const uint
6565
spi_tx8fast(HSPI, src[i]);
6666
++i;
6767
}
68+
// wait for SPI transaction to complete
69+
while (spi_busy(HSPI)) {
70+
}
6871
} else {
6972
// we need to read and write data
7073

0 commit comments

Comments
 (0)