fix(boards): initialize Heltec V4 R8 TFT

This commit is contained in:
agessaman committed 2026-08-23 16:34:27 -07:00
1 parent 104143bba6
commit 910e6ab03d
3 files changed
+28 -7

No files matched your search

+17 -4
View File
@@ -4,10 +4,6 @@
#define PIN_TFT_MISO -1
#endif
#ifndef PIN_TFT_LEDA_CTL_ACTIVE
#define PIN_TFT_LEDA_CTL_ACTIVE HIGH
#endif
#ifndef DISPLAY_ROTATION
#define DISPLAY_ROTATION 3
#endif
@@ -42,12 +38,18 @@ bool ST7789LCDDisplay::begin() {
if (!_isOn) {
if (_peripher_power) {
_peripher_power->claim();
#ifdef HELTEC_V4_R8_TFT
delay(100);
#endif
}
if (PIN_TFT_LEDA_CTL != -1) {
pinMode(PIN_TFT_LEDA_CTL, OUTPUT);
#ifdef HELTEC_V4_R8_TFT
digitalWrite(PIN_TFT_LEDA_CTL, !PIN_TFT_LEDA_CTL_ACTIVE);
#else
digitalWrite(PIN_TFT_LEDA_CTL, HIGH);
#endif
}
// Im not sure if this is just a t-deck problem or not, if your display is slow try this.
@@ -65,9 +67,11 @@ bool ST7789LCDDisplay::begin() {
display.setTextSize(2 * DISPLAY_SCALE_X);
display.cp437(true); // Use full 256 char 'Code Page 437' font
#ifdef HELTEC_V4_R8_TFT
if (PIN_TFT_LEDA_CTL != -1) {
digitalWrite(PIN_TFT_LEDA_CTL, PIN_TFT_LEDA_CTL_ACTIVE);
}
#endif
_isOn = true;
}
@@ -82,11 +86,20 @@ void ST7789LCDDisplay::turnOn() {
void ST7789LCDDisplay::turnOff() {
if (_isOn) {
if (PIN_TFT_LEDA_CTL != -1) {
#ifdef HELTEC_V4_R8_TFT
digitalWrite(PIN_TFT_LEDA_CTL, !PIN_TFT_LEDA_CTL_ACTIVE);
#else
digitalWrite(PIN_TFT_LEDA_CTL, HIGH);
#endif
}
if (PIN_TFT_RST != -1) {
digitalWrite(PIN_TFT_RST, LOW);
}
#ifndef HELTEC_V4_R8_TFT
if (PIN_TFT_LEDA_CTL != -1) {
digitalWrite(PIN_TFT_LEDA_CTL, LOW);
}
#endif
_isOn = false;
if (_peripher_power) _peripher_power->release();