From fb258a920170c64caddaed3433e4287885564ea1 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Sun, 12 Jul 2020 16:19:26 +0300 Subject: [PATCH] More safe read data on SPI --- ili9341.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ili9341.c b/ili9341.c index 69e3454..9cbebf9 100644 --- a/ili9341.c +++ b/ili9341.c @@ -223,7 +223,7 @@ static void spi_TxBuffer(uint8_t *buffer, uint16_t len) { static uint8_t spi_RxByte(void) { // Start RX clock (by sending data) 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); }