Fix #503
The s60sc Adafruit_Touch library fork for the ESP32 parallel mode uses the TFT_WR pin as an analogue input to read the screen resistance. The TFT_eSPI library kept TFT_CS low permanently for performance reasons, but when used with the touch library a low analogue value on the TFT_WR pin will write spurious data to the display. This change toggle TFT_CS so it is only low during TFT parallel bus writes. The performance reduction is small.
This commit is contained in:
parent
308b46e125
commit
d02fe55c46
12
TFT_eSPI.h
12
TFT_eSPI.h
|
|
@ -190,8 +190,16 @@
|
||||||
#define CS_H digitalWrite(TFT_CS, HIGH)
|
#define CS_H digitalWrite(TFT_CS, HIGH)
|
||||||
#elif defined (ESP32)
|
#elif defined (ESP32)
|
||||||
#if defined (ESP32_PARALLEL)
|
#if defined (ESP32_PARALLEL)
|
||||||
#define CS_L // The TFT CS is set permanently low during init()
|
#if TFT_CS >= 32
|
||||||
#define CS_H
|
#define CS_L GPIO.out1_w1tc.val = (1 << (TFT_CS - 32))
|
||||||
|
#define CS_H GPIO.out1_w1ts.val = (1 << (TFT_CS - 32))
|
||||||
|
#elif TFT_CS >= 0
|
||||||
|
#define CS_L GPIO.out_w1tc = (1 << TFT_CS)
|
||||||
|
#define CS_H GPIO.out_w1ts = (1 << TFT_CS)
|
||||||
|
#else
|
||||||
|
#define CS_L
|
||||||
|
#define CS_H
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#if TFT_CS >= 32
|
#if TFT_CS >= 32
|
||||||
#ifdef RPI_ILI9486_DRIVER // RPi display needs a slower CS change
|
#ifdef RPI_ILI9486_DRIVER // RPi display needs a slower CS change
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue