mirror of
https://github.com/ttrftech/NanoVNA.git
synced 2025-12-06 03:31:59 +01:00
More safe read data on SPI
This commit is contained in:
parent
8c131098f0
commit
fb258a9201
|
|
@ -223,7 +223,7 @@ static void spi_TxBuffer(uint8_t *buffer, uint16_t len) {
|
||||||
static uint8_t spi_RxByte(void) {
|
static uint8_t spi_RxByte(void) {
|
||||||
// Start RX clock (by sending data)
|
// Start RX clock (by sending data)
|
||||||
SPI_WRITE_8BIT(LCD_SPI, 0xFF);
|
SPI_WRITE_8BIT(LCD_SPI, 0xFF);
|
||||||
while (SPI_RX_IS_EMPTY(LCD_SPI));
|
while (SPI_RX_IS_EMPTY(LCD_SPI)||SPI_IS_BUSY(LCD_SPI));
|
||||||
return SPI_READ_8BIT(LCD_SPI);
|
return SPI_READ_8BIT(LCD_SPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue