STM32F1: Sync SPI changes from maple master (#15266)

This commit is contained in:
Tanguy Pruvot
2019-09-15 20:46:17 +02:00
committed by Scott Lahteine
parent 20fbb751f1
commit 02d400e413
2 changed files with 19 additions and 23 deletions

View File

@@ -406,4 +406,12 @@ private:
*/
};
/**
* @brief Wait until TXE (tx empty) flag is set and BSY (busy) flag unset.
*/
static inline void waitSpiTxEnd(spi_dev *spi_d) {
while (spi_is_tx_empty(spi_d) == 0) { /* nada */ } // wait until TXE=1
while (spi_is_busy(spi_d) != 0) { /* nada */ } // wait until BSY=0
}
extern SPIClass SPI;