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:
Bodmer
2020-01-02 11:53:50 +00:00
committed by GitHub
parent 308b46e125
commit d02fe55c46

View File

@@ -190,8 +190,16 @@
#define CS_H digitalWrite(TFT_CS, HIGH)
#elif defined (ESP32)
#if defined (ESP32_PARALLEL)
#define CS_L // The TFT CS is set permanently low during init()
#define CS_H
#if TFT_CS >= 32
#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
#if TFT_CS >= 32
#ifdef RPI_ILI9486_DRIVER // RPi display needs a slower CS change