From 75fdc4d945229d61f25c6456502f58d7c8827ecc Mon Sep 17 00:00:00 2001 From: kaidegit <60053077+kaidegit@users.noreply.github.com> Date: Tue, 11 Jan 2022 15:53:18 +0800 Subject: [PATCH] fix a mistake --- TFT_eSPI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TFT_eSPI.cpp b/TFT_eSPI.cpp index fd093f0..51cf74d 100644 --- a/TFT_eSPI.cpp +++ b/TFT_eSPI.cpp @@ -3095,7 +3095,7 @@ void TFT_eSPI::setWindow(int32_t x0, int32_t y0, int32_t x1, int32_t y1) DC_C; #if !defined (SPI_18BIT_DRIVER) #if defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16 bit transfers - spi_set_format(SPI_X, 16, (spi_cpol_t)(TFT_SPI_MODE & 0b10)), (spi_cpha_t)(TFT_SPI_MODE & 0b01), SPI_MSB_FIRST); + spi_set_format(SPI_X, 16, (spi_cpol_t)(!!(TFT_SPI_MODE & 0b10)), (spi_cpha_t)(!!(TFT_SPI_MODE & 0b01)), SPI_MSB_FIRST); #else spi_set_format(SPI_X, 8, (spi_cpol_t)(!!(TFT_SPI_MODE & 0b10)), (spi_cpha_t)(!!(TFT_SPI_MODE & 0b01)), SPI_MSB_FIRST); #endif