From c3332af471be3dab2f6e6f3cd3fd52f2c7bd01f0 Mon Sep 17 00:00:00 2001 From: Hamid Saffari <35362339+HamidSaffari@users.noreply.github.com> Date: Fri, 27 Mar 2020 16:52:43 +0430 Subject: [PATCH] Added Second SPI option for Touchpad driver --- Processors/TFT_eSPI_Generic.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Processors/TFT_eSPI_Generic.c b/Processors/TFT_eSPI_Generic.c index a30f1fb..9a758c5 100644 --- a/Processors/TFT_eSPI_Generic.c +++ b/Processors/TFT_eSPI_Generic.c @@ -6,8 +6,20 @@ // Global variables //////////////////////////////////////////////////////////////////////////////////////// -// Select the SPI port to use -SPIClass& spi = SPI; +#if defined (TFT_PARALLEL_8_BIT) + // No globals +#else + // Select the SPI port to use + SPIClass& spi = SPI; +#endif + +#ifdef TOUCH_CS + #if defined (SPI2_for_TOUCH_PORT) + #error define your board for second SPI configuration + #else + SPIClass& spi_touch = SPI; + #endif +#endif //////////////////////////////////////////////////////////////////////////////////////// #if defined (TFT_SDA_READ) && !defined (TFT_PARALLEL_8_BIT)