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 #3487.
pull/3422/merge
Damien George 2017-12-14 10:40:35 +11:00
rodzic bb516af1eb
commit badaf3ecfe
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -65,6 +65,9 @@ STATIC void machine_hspi_transfer(mp_obj_base_t *self_in, size_t len, const uint
spi_tx8fast(HSPI, src[i]);
++i;
}
// wait for SPI transaction to complete
while (spi_busy(HSPI)) {
}
} else {
// we need to read and write data