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.
This commit is contained in:
Damien George 2017-12-14 10:40:35 +11:00
parent bb516af1eb
commit badaf3ecfe
1 changed files with 3 additions and 0 deletions

View File

@ -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