Update esp23_2432s028r.cpp support for another ESP32_2432S028 variant

This commit is contained in:
p43lz3r 2024-01-15 10:21:21 +01:00 committed by GitHub
parent 993d671af4
commit b737f8d061
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
#include "displayDriver.h" #include "displayDriver.h"
#ifdef ESP32_2432S028R #if defined ESP32_2432S028R || ESP32_2432S028_2USB
#include <TFT_eSPI.h> #include <TFT_eSPI.h>
#include <TFT_eTouch.h> #include <TFT_eTouch.h>
@ -32,6 +32,17 @@ void esp32_2432S028R_Init(void)
{ {
tft.init(); tft.init();
tft.setRotation(1); tft.setRotation(1);
#ifdef ESP32_2432S028_2USB
/*
In addition to TFT_INVERSION this adjusts the gamma curve to have better
picture quality for this type of ESP32_2432S028 TFT with for example two USB connectors
*/
tft.writecommand(ILI9341_GAMMASET); // Gamma curve selected
tft.writedata(2);
delay(120);
tft.writecommand(ILI9341_GAMMASET); // Gamma curve selected
tft.writedata(1);
#endif
tft.setSwapBytes(true); // Swap the colour byte order when rendering tft.setSwapBytes(true); // Swap the colour byte order when rendering
hSPI.begin(TOUCH_CLK, TOUCH_MISO, TOUCH_MOSI, ETOUCH_CS); hSPI.begin(TOUCH_CLK, TOUCH_MISO, TOUCH_MOSI, ETOUCH_CS);
touch.init(); touch.init();