Update TOUCH_DRIVER values

This commit is contained in:
fvanroie 2020-12-17 22:27:36 +01:00
parent 7ca93b2631
commit d50c8929a2
3 changed files with 18 additions and 18 deletions

View File

@ -41,7 +41,7 @@
#endif #endif
#ifndef TOUCH_DRIVER #ifndef TOUCH_DRIVER
#define TOUCH_DRIVER 99 #define TOUCH_DRIVER -1 // No Touch
#endif #endif
#define BACKLIGHT_CHANNEL 15 // pwm channel 0-15 #define BACKLIGHT_CHANNEL 15 // pwm channel 0-15
@ -242,8 +242,8 @@ static void ICACHE_RAM_ATTR lv_tick_handler(void)
// return false; /*Return `false` because we are not buffering and no more data to read*/ // return false; /*Return `false` because we are not buffering and no more data to read*/
// } // }
#if TOUCH_DRIVER == 2 #if TOUCH_DRIVER == 0xADC // Analog Digital Touch Conroller
#include "Touchscreen.h" // For Uno Shield or ADC based resistive touchscreens #include "Touchscreen.h" // For Uno Shield or ADC based resistive touchscreens
boolean Touch_getXY(uint16_t * x, uint16_t * y, boolean showTouch) boolean Touch_getXY(uint16_t * x, uint16_t * y, boolean showTouch)
{ {
@ -297,7 +297,7 @@ boolean Touch_getXY(uint16_t * x, uint16_t * y, boolean showTouch)
} }
#endif #endif
#if TOUCH_DRIVER == 1 #if TOUCH_DRIVER == 911
#include <Wire.h> #include <Wire.h>
#include "Goodix.h" #include "Goodix.h"
@ -399,12 +399,12 @@ bool IRAM_ATTR my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t *
#ifdef TOUCH_CS #ifdef TOUCH_CS
uint16_t touchX, touchY; uint16_t touchX, touchY;
bool touched; bool touched;
#if TOUCH_DRIVER == 0 #if TOUCH_DRIVER == 2046 // XPT2046 Resistive touch panel driver
touched = tft_espi_get_touch(&touchX, &touchY, 300); touched = tft_espi_get_touch(&touchX, &touchY, 300);
#elif TOUCH_DRIVER == 1 #elif TOUCH_DRIVER == 911
// return false; // return false;
touched = GT911_getXY(&touchX, &touchY, true); touched = GT911_getXY(&touchX, &touchY, true);
#elif TOUCH_DRIVER == 2 #elif TOUCH_DRIVER == 0xADC // Analog Digital Touch Conroller
touched = Touch_getXY(&touchX, &touchY, false); touched = Touch_getXY(&touchX, &touchY, false);
#else #else
// xpt2046_alt_drv_read(indev_driver, data); // xpt2046_alt_drv_read(indev_driver, data);
@ -430,7 +430,7 @@ bool IRAM_ATTR my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t *
void guiCalibrate() void guiCalibrate()
{ {
#if TOUCH_DRIVER == 0 && USE_TFT_ESPI > 0 #if TOUCH_DRIVER == 2046 && USE_TFT_ESPI > 0
#ifdef TOUCH_CS #ifdef TOUCH_CS
tft_espi_calibrate(calData); tft_espi_calibrate(calData);
#endif #endif
@ -455,7 +455,7 @@ void guiSetup()
tft_espi_init(guiRotation); tft_espi_init(guiRotation);
#endif #endif
#if TOUCH_DRIVER == 1 #if TOUCH_DRIVER == 911
GT911_setup(); GT911_setup();
#endif #endif
@ -470,7 +470,7 @@ void guiSetup()
#endif #endif
tft.setRotation(guiRotation); /* 1/3=Landscape or 0/2=Portrait orientation */ tft.setRotation(guiRotation); /* 1/3=Landscape or 0/2=Portrait orientation */
#if TOUCH_DRIVER == 0 && USE_TFT_ESPI > 0 #if TOUCH_DRIVER == 2046 && USE_TFT_ESPI > 0
tft_espi_set_touch(calData); tft_espi_set_touch(calData);
#endif #endif
#endif #endif
@ -650,7 +650,7 @@ void IRAM_ATTR guiLoop(void)
tick.update(); tick.update();
#endif #endif
#if TOUCH_DRIVER == 1 #if TOUCH_DRIVER == 911
touch.loop(); touch.loop();
#endif #endif
} }
@ -762,7 +762,7 @@ bool guiGetConfig(const JsonObject & settings)
} else { } else {
changed = true; changed = true;
#if TOUCH_DRIVER == 0 && USE_TFT_ESPI > 0 && defined(TOUCH_CS) #if TOUCH_DRIVER == 2046 && USE_TFT_ESPI > 0 && defined(TOUCH_CS)
tft_espi_set_touch(calData); tft_espi_set_touch(calData);
#endif #endif
} }
@ -777,7 +777,7 @@ bool guiGetConfig(const JsonObject & settings)
} }
changed = true; changed = true;
#if TOUCH_DRIVER == 0 && USE_TFT_ESPI > 0 && defined(TOUCH_CS) #if TOUCH_DRIVER == 2046 && USE_TFT_ESPI > 0 && defined(TOUCH_CS)
tft_espi_set_touch(calData); tft_espi_set_touch(calData);
#endif #endif
} }
@ -836,7 +836,7 @@ bool guiSetConfig(const JsonObject & settings)
oobeSetAutoCalibrate(true); oobeSetAutoCalibrate(true);
} }
#if TOUCH_DRIVER == 0 && USE_TFT_ESPI > 0 && defined(TOUCH_CS) #if TOUCH_DRIVER == 2046 && USE_TFT_ESPI > 0 && defined(TOUCH_CS)
if(status) tft_espi_set_touch(calData); if(status) tft_espi_set_touch(calData);
#endif #endif
changed |= status; changed |= status;

View File

@ -38,7 +38,7 @@ build_flags =
-D TFT_BCKL=5 ;None, configurable via web UI (e.g. 2 for D4) -D TFT_BCKL=5 ;None, configurable via web UI (e.g. 2 for D4)
-D SUPPORT_TRANSACTIONS -D SUPPORT_TRANSACTIONS
-D TOUCH_CS=22 -D TOUCH_CS=22
-D TOUCH_DRIVER=0 ; XPT2606 Resistive touch panel driver -D TOUCH_DRIVER=2046 ; XPT2606 Resistive touch panel driver
-D SPI_FREQUENCY=27000000 -D SPI_FREQUENCY=27000000
-D SPI_TOUCH_FREQUENCY=2500000 -D SPI_TOUCH_FREQUENCY=2500000
-D SPI_READ_FREQUENCY=16000000 -D SPI_READ_FREQUENCY=16000000

View File

@ -23,7 +23,7 @@ lolin24 =
-D SPI_TOUCH_FREQUENCY=2500000 -D SPI_TOUCH_FREQUENCY=2500000
-D SPI_READ_FREQUENCY=20000000 -D SPI_READ_FREQUENCY=20000000
-D USER_SETUP_LOADED=1 -D USER_SETUP_LOADED=1
-D TOUCH_DRIVER=0 ; XPT2606 Resistive touch panel driver -D TOUCH_DRIVER=2046 ; XPT2046 Resistive touch panel driver
-D SUPPORT_TRANSACTIONS -D SUPPORT_TRANSACTIONS
raspberrypi = raspberrypi =
@ -35,7 +35,7 @@ raspberrypi =
-D SPI_FREQUENCY=80000000 -D SPI_FREQUENCY=80000000
-D SPI_TOUCH_FREQUENCY=2500000 -D SPI_TOUCH_FREQUENCY=2500000
-D USER_SETUP_LOADED=1 -D USER_SETUP_LOADED=1
-D TOUCH_DRIVER=0 ; XPT2606 Resistive touch panel driver -D TOUCH_DRIVER=2046 ; XPT2046 Resistive touch panel driver
-D SUPPORT_TRANSACTIONS -D SUPPORT_TRANSACTIONS
mrb3511 = mrb3511 =
@ -45,5 +45,5 @@ mrb3511 =
-D TFT_HEIGHT=480 -D TFT_HEIGHT=480
-D TFT_ROTATION=0 ; see TFT_ROTATION values -D TFT_ROTATION=0 ; see TFT_ROTATION values
-D USER_SETUP_LOADED=1 -D USER_SETUP_LOADED=1
-D TOUCH_DRIVER=1 ; GT911 Capacitive touch panel driver -D TOUCH_DRIVER=911 ; GT911 Capacitive touch panel driver
-D SUPPORT_TRANSACTIONS -D SUPPORT_TRANSACTIONS