Skip to content

Commit f511c26

Browse files
committed
ESP8266: Make sure SPI write finishes before returning.
Fixes adafruit#62.
1 parent 49287e9 commit f511c26

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • esp8266/common-hal/nativeio

esp8266/common-hal/nativeio/SPI.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ bool common_hal_nativeio_spi_write(nativeio_spi_obj_t *self,
122122
spi_tx8fast(HSPI, data[i]);
123123
++i;
124124
}
125+
while (spi_busy(HSPI)) {}; // Wait for SPI to finish the last byte.
125126
return true;
126127
}
127128

0 commit comments

Comments
 (0)