diff --git a/boards/CYD-2432S028.ini b/boards/CYD-2432S028.ini index b809c9e28..010819505 100644 --- a/boards/CYD-2432S028.ini +++ b/boards/CYD-2432S028.ini @@ -132,6 +132,9 @@ build_flags = -DSPI_TOUCH_FREQUENCY=2500000 -DTOUCH_CS=33 + ;TouchScreen Controller + -DHAS_TOUCH=1 + ;SD Card Setup pins -DSDCARD_CS=5 -DSDCARD_SCK=18 @@ -218,9 +221,6 @@ build_flags = ${env:CYD-2432S028.build_flags} ;-DTFT_INVERSION_ON TFT is not color inverted -DTFT_BL=27 - - ;TouchScreen Controller - -DHAS_TOUCH=1 -DTOUCH_XPT2046_SPI -DXPT2046_SPI_BUS_MOSI_IO_NUM=13 diff --git a/boards/CYD-2432S028/interface.cpp b/boards/CYD-2432S028/interface.cpp index 79f98049a..adb4e5cad 100644 --- a/boards/CYD-2432S028/interface.cpp +++ b/boards/CYD-2432S028/interface.cpp @@ -13,7 +13,7 @@ #define CYD28_DISPLAY_VER_RES_MAX 240 CYD28_TouchR touch(CYD28_DISPLAY_HOR_RES_MAX, CYD28_DISPLAY_VER_RES_MAX); #if defined(TOUCH_XPT2046_SPI) - #define XPT2046_CS DXPT2046_SPI_CONFIG_CS_GPIO_NUM + #define XPT2046_CS XPT2046_SPI_CONFIG_CS_GPIO_NUM #else #define XPT2046_CS 33 #endif @@ -33,7 +33,10 @@ void _setup_gpio() { Serial.println("Touch IC not Started"); log_i("Touch IC not Started"); } else log_i("Touch IC Started"); - digitalWrite(XPT2046_CS, LOW); + + #ifndef HAS_CAPACITIVE_TOUCH // Capacitive Touchscreen uses I2C to communicate + digitalWrite(XPT2046_CS, LOW); + #endif }