Skip to content

Commit 50ea849

Browse files
committed
Adjust gamma for display ID 0x04858552
1 parent 6e18ae1 commit 50ea849

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

ats-mini/ats-mini.ino

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,24 @@ void setup()
134134

135135
// Detect and fix the mirrored & inverted display
136136
// https://github.com/esp32-si4732/ats-mini/issues/41
137-
if(tft.readcommand8(ST7789_RDDID, 3) == 0x93)
137+
uint8_t did3 = tft.readcommand8(ST7789_RDDID, 3);
138+
// 0x048181B3 - the original display
139+
// 0x04858552 - high gamma display
140+
// 0x00009307 - inverted & mirrored display
141+
if(did3 == 0x93)
138142
{
139143
tft.invertDisplay(0);
140144
tft.writecommand(TFT_MADCTL);
141145
tft.writedata(TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_BGR);
142146
}
147+
else if(did3 == 0x85)
148+
{
149+
tft.writecommand(0x26); // GAMSET
150+
tft.writedata(8); // Gamma Curve 3
151+
152+
tft.writecommand(0x55); // WRCACE (content adaptive brightness and color)
153+
tft.writedata(0xB1); // High enhancement, UI mode
154+
}
143155

144156
tft.fillScreen(TH.bg);
145157
spr.createSprite(320, 170);

changelog/+gamma.changed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Adjust gamma for display ID 0x04858552 so the themes look closer to how they were designed (at least Orange now doesn't look like a lemon).

0 commit comments

Comments
 (0)