mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-09 11:27:29 +00:00
for #4154 use a binary gpio transformer to manage vext on heltec-tracker (saves power)
This commit is contained in:
@@ -25,6 +25,8 @@ extern SX1509 gpioExtender;
|
||||
#define TFT_INVERT true
|
||||
#endif
|
||||
|
||||
GpioPin *TFTDisplay::backlightEnable;
|
||||
|
||||
class LGFX : public lgfx::LGFX_Device
|
||||
{
|
||||
lgfx::Panel_ST7735S _panel_instance;
|
||||
@@ -584,6 +586,7 @@ void TFTDisplay::sendCommand(uint8_t com)
|
||||
// handle display on/off directly
|
||||
switch (com) {
|
||||
case DISPLAYON: {
|
||||
// LOG_DEBUG("Display on\n");
|
||||
backlightEnable->set(true);
|
||||
#if ARCH_PORTDUINO
|
||||
display(true);
|
||||
@@ -607,6 +610,7 @@ void TFTDisplay::sendCommand(uint8_t com)
|
||||
break;
|
||||
}
|
||||
case DISPLAYOFF: {
|
||||
// LOG_DEBUG("Display off\n");
|
||||
backlightEnable->set(false);
|
||||
#if ARCH_PORTDUINO
|
||||
tft->clear();
|
||||
|
||||
@@ -43,8 +43,10 @@ class TFTDisplay : public OLEDDisplay
|
||||
/**
|
||||
* This is normally managed entirely by TFTDisplay, but some rare applications (heltec tracker) might need to replace the
|
||||
* default GPIO behavior with something a bit more complex.
|
||||
*
|
||||
* We (cruftily) make it static so that variant.cpp can access it without needing a ptr to the TFTDisplay instance.
|
||||
*/
|
||||
GpioPin *backlightEnable;
|
||||
static GpioPin *backlightEnable;
|
||||
|
||||
protected:
|
||||
// the header size of the buffer used, e.g. for the SPI command header
|
||||
|
||||
Reference in New Issue
Block a user