mirror of
https://github.com/agessaman/MeshCore.git
synced 2026-08-27 22:34:14 +00:00
fix(boards): reset Heltec V4 R8 TFT on GPIO 21
GPIO 21 is the Expansion Kit V2 panel reset, not touch reset. Leaving RST unwired left the ST7789 blank after a bogus touch pulse.
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
#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
|
||||
@@ -36,11 +40,14 @@ ColorVal UIColor::corp_blue = 0x001A;
|
||||
|
||||
bool ST7789LCDDisplay::begin() {
|
||||
if (!_isOn) {
|
||||
if (_peripher_power) _peripher_power->claim();
|
||||
if (_peripher_power) {
|
||||
_peripher_power->claim();
|
||||
delay(100);
|
||||
}
|
||||
|
||||
if (PIN_TFT_LEDA_CTL != -1) {
|
||||
pinMode(PIN_TFT_LEDA_CTL, OUTPUT);
|
||||
digitalWrite(PIN_TFT_LEDA_CTL, HIGH);
|
||||
digitalWrite(PIN_TFT_LEDA_CTL, !PIN_TFT_LEDA_CTL_ACTIVE);
|
||||
}
|
||||
|
||||
// Im not sure if this is just a t-deck problem or not, if your display is slow try this.
|
||||
@@ -55,9 +62,13 @@ bool ST7789LCDDisplay::begin() {
|
||||
|
||||
display.fillScreen(ST77XX_BLACK);
|
||||
display.setTextColor(ST77XX_WHITE);
|
||||
display.setTextSize(2 * DISPLAY_SCALE_X);
|
||||
display.setTextSize(2 * DISPLAY_SCALE_X);
|
||||
display.cp437(true); // Use full 256 char 'Code Page 437' font
|
||||
|
||||
|
||||
if (PIN_TFT_LEDA_CTL != -1) {
|
||||
digitalWrite(PIN_TFT_LEDA_CTL, PIN_TFT_LEDA_CTL_ACTIVE);
|
||||
}
|
||||
|
||||
_isOn = true;
|
||||
}
|
||||
|
||||
@@ -71,14 +82,11 @@ void ST7789LCDDisplay::turnOn() {
|
||||
void ST7789LCDDisplay::turnOff() {
|
||||
if (_isOn) {
|
||||
if (PIN_TFT_LEDA_CTL != -1) {
|
||||
digitalWrite(PIN_TFT_LEDA_CTL, HIGH);
|
||||
digitalWrite(PIN_TFT_LEDA_CTL, !PIN_TFT_LEDA_CTL_ACTIVE);
|
||||
}
|
||||
if (PIN_TFT_RST != -1) {
|
||||
digitalWrite(PIN_TFT_RST, LOW);
|
||||
}
|
||||
if (PIN_TFT_LEDA_CTL != -1) {
|
||||
digitalWrite(PIN_TFT_LEDA_CTL, LOW);
|
||||
}
|
||||
_isOn = false;
|
||||
|
||||
if (_peripher_power) _peripher_power->release();
|
||||
|
||||
@@ -8,6 +8,8 @@ void HeltecV4R8Board::begin() {
|
||||
|
||||
loRaFEMControl.init();
|
||||
|
||||
// Expansion Kit CHSC6X touch RST/INT are unwired. GPIO 21 is TFT RST
|
||||
// (PIN_TFT_RST), owned by ST7789LCDDisplay. Do not pulse it here.
|
||||
#ifdef PIN_TOUCH_RST
|
||||
pinMode(PIN_TOUCH_RST, OUTPUT);
|
||||
digitalWrite(PIN_TOUCH_RST, HIGH);
|
||||
|
||||
@@ -65,7 +65,7 @@ build_flags =
|
||||
-D PIN_BOARD_SCL=18
|
||||
-D DISPLAY_SCALE_X=2.5
|
||||
-D DISPLAY_SCALE_Y=3.75
|
||||
-D PIN_TFT_RST=-1
|
||||
-D PIN_TFT_RST=21
|
||||
-D PIN_TFT_VDD_CTL=-1
|
||||
-D PIN_TFT_LEDA_CTL=44
|
||||
-D PIN_TFT_LEDA_CTL_ACTIVE=HIGH
|
||||
@@ -75,7 +75,6 @@ build_flags =
|
||||
-D PIN_TFT_SDA=15
|
||||
-D PIN_TFT_MISO=45
|
||||
-D PIN_BUZZER=4
|
||||
-D PIN_TOUCH_RST=21
|
||||
build_src_filter = ${Heltec_v4_r8.build_src_filter}
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
lib_deps =
|
||||
|
||||
Reference in New Issue
Block a user