mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-07 06:34:44 +02:00
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:
12
TFT_eSPI.h
12
TFT_eSPI.h
@@ -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
|
||||
|
Reference in New Issue
Block a user