Skip to content

Commit

Permalink
esp8266/machine_hspi: After an SPI write wait for last byte to transfer.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dpgeorge committed Dec 13, 2017
1 parent bb516af commit badaf3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ports/esp8266/machine_hspi.c
Expand Up @@ -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

Expand Down

0 comments on commit badaf3e

Please sign in to comment.