diff --git a/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp b/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp index 2aa114b9..33f480de 100644 --- a/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp +++ b/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp @@ -209,7 +209,27 @@ namespace lgfx } auto spi_mode = _cfg.spi_mode; - uint32_t pin = (spi_mode & 2) ? SPI_CK_IDLE_EDGE : 0; + uint32_t pin = 0 +#if defined ( SPI_CS0_DIS ) + | SPI_CS0_DIS +#endif +#if defined ( SPI_CS1_DIS ) + | SPI_CS1_DIS +#endif +#if defined ( SPI_CS2_DIS ) + | SPI_CS2_DIS +#endif +#if defined ( SPI_CS3_DIS ) + | SPI_CS3_DIS +#endif +#if defined ( SPI_CS4_DIS ) + | SPI_CS4_DIS +#endif +#if defined ( SPI_CS5_DIS ) + | SPI_CS5_DIS +#endif + ; + if (spi_mode & 2) pin = SPI_CK_IDLE_EDGE; if (_cfg.use_lock) spi::beginTransaction(_cfg.spi_host); diff --git a/src/lgfx/v1/platforms/esp32/common.cpp b/src/lgfx/v1/platforms/esp32/common.cpp index ffd53fe7..ff7f7713 100644 --- a/src/lgfx/v1/platforms/esp32/common.cpp +++ b/src/lgfx/v1/platforms/esp32/common.cpp @@ -580,7 +580,26 @@ namespace lgfx uint32_t user = SPI_USR_MOSI | SPI_USR_MISO | SPI_DOUTDIN; if (spi_mode == 1 || spi_mode == 2) user |= SPI_CK_OUT_EDGE; - uint32_t pin = 0; + uint32_t pin = 0 +#if defined ( SPI_CS0_DIS ) + | SPI_CS0_DIS +#endif +#if defined ( SPI_CS1_DIS ) + | SPI_CS1_DIS +#endif +#if defined ( SPI_CS2_DIS ) + | SPI_CS2_DIS +#endif +#if defined ( SPI_CS3_DIS ) + | SPI_CS3_DIS +#endif +#if defined ( SPI_CS4_DIS ) + | SPI_CS4_DIS +#endif +#if defined ( SPI_CS5_DIS ) + | SPI_CS5_DIS +#endif + ; if (spi_mode & 2) pin = SPI_CK_IDLE_EDGE; beginTransaction(spi_host);