From b737f8d0615b989dfdc15d0ce8c79dcd7172dcd0 Mon Sep 17 00:00:00 2001 From: p43lz3r <16374477+paelzer@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:21:21 +0100 Subject: [PATCH] Update esp23_2432s028r.cpp support for another ESP32_2432S028 variant --- src/drivers/displays/esp23_2432s028r.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/drivers/displays/esp23_2432s028r.cpp b/src/drivers/displays/esp23_2432s028r.cpp index f86a91c..ec9431f 100644 --- a/src/drivers/displays/esp23_2432s028r.cpp +++ b/src/drivers/displays/esp23_2432s028r.cpp @@ -1,6 +1,6 @@ #include "displayDriver.h" -#ifdef ESP32_2432S028R +#if defined ESP32_2432S028R || ESP32_2432S028_2USB #include #include @@ -32,6 +32,17 @@ void esp32_2432S028R_Init(void) { tft.init(); 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 hSPI.begin(TOUCH_CLK, TOUCH_MISO, TOUCH_MOSI, ETOUCH_CS); touch.init();