mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-29 06:06:40 +00:00
Use TOUCH_DRIVER instead of TOUCH_CS
This commit is contained in:
parent
6b0150a624
commit
2facfff7f5
@ -22,6 +22,10 @@
|
|||||||
#include "png_decoder.h"
|
#include "png_decoder.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef TOUCH_DRIVER
|
||||||
|
#define TOUCH_DRIVER = -1
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HASP_USE_SPIFFS
|
#if HASP_USE_SPIFFS
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
#include "SPIFFS.h"
|
#include "SPIFFS.h"
|
||||||
@ -537,7 +541,7 @@ 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;
|
||||||
|
|
||||||
#ifdef TOUCH_CS
|
#if TOUCH_DRIVER == 0
|
||||||
bool touched = tft.getTouch(&touchX, &touchY, 600);
|
bool touched = tft.getTouch(&touchX, &touchY, 600);
|
||||||
#elif TOUCH_DRIVER == 1
|
#elif TOUCH_DRIVER == 1
|
||||||
// return false;
|
// return false;
|
||||||
@ -574,7 +578,7 @@ bool IRAM_ATTR my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t *
|
|||||||
|
|
||||||
void guiCalibrate()
|
void guiCalibrate()
|
||||||
{
|
{
|
||||||
#ifdef TOUCH_CS
|
#if TOUCH_DRIVER == 0
|
||||||
tft.fillScreen(TFT_BLACK);
|
tft.fillScreen(TFT_BLACK);
|
||||||
tft.setCursor(20, 0);
|
tft.setCursor(20, 0);
|
||||||
tft.setTextFont(1);
|
tft.setTextFont(1);
|
||||||
@ -603,7 +607,7 @@ void guiSetup()
|
|||||||
/* TFT init */
|
/* TFT init */
|
||||||
tft.begin();
|
tft.begin();
|
||||||
tft.setRotation(guiRotation); /* 1/3=Landscape or 0/2=Portrait orientation */
|
tft.setRotation(guiRotation); /* 1/3=Landscape or 0/2=Portrait orientation */
|
||||||
#ifdef TOUCH_CS
|
#if TOUCH_DRIVER == 0
|
||||||
tft.setTouch(calData);
|
tft.setTouch(calData);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user