mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-01 10:19:59 +00:00
Remove redundant ST7735_BL variant defs.
No need for _V05 and _V03 definitions - I think there was a slight misunderstanding on how variant files are supposed to _decrease_ #ifdef code in the cpp files.
This commit is contained in:
parent
d017fc7a5d
commit
7fb9b094d5
@ -95,14 +95,8 @@ class LGFX : public lgfx::LGFX_Device
|
||||
{
|
||||
auto cfg = _light_instance.config(); // Gets a structure for backlight settings.
|
||||
|
||||
#ifdef ST7735_BL_V03
|
||||
cfg.pin_bl = ST7735_BL_V03;
|
||||
#elif defined(ST7735_BL_V05)
|
||||
cfg.pin_bl = ST7735_BL_V05;
|
||||
#else
|
||||
cfg.pin_bl = ST7735_BL; // Pin number to which the backlight is connected
|
||||
#endif
|
||||
cfg.invert = true; // true to invert the brightness of the backlight
|
||||
cfg.invert = true; // true to invert the brightness of the backlight
|
||||
// cfg.freq = 44100; // PWM frequency of backlight
|
||||
// cfg.pwm_channel = 1; // PWM channel number to use
|
||||
|
||||
@ -581,11 +575,9 @@ void TFTDisplay::sendCommand(uint8_t com)
|
||||
display(true);
|
||||
if (settingsMap[displayBacklight] > 0)
|
||||
digitalWrite(settingsMap[displayBacklight], TFT_BACKLIGHT_ON);
|
||||
#elif defined(ST7735_BL_V03)
|
||||
digitalWrite(ST7735_BL_V03, TFT_BACKLIGHT_ON);
|
||||
#elif defined(ST7735_BL_V05)
|
||||
pinMode(ST7735_BL_V05, OUTPUT);
|
||||
digitalWrite(ST7735_BL_V05, TFT_BACKLIGHT_ON);
|
||||
#elif defined(ST7735_BL)
|
||||
pinMode(ST7735_BL, OUTPUT);
|
||||
digitalWrite(ST7735_BL, TFT_BACKLIGHT_ON);
|
||||
#elif !defined(RAK14014) && !defined(M5STACK) && !defined(UNPHONE)
|
||||
tft->wakeup();
|
||||
tft->powerSaveOff();
|
||||
@ -614,11 +606,9 @@ void TFTDisplay::sendCommand(uint8_t com)
|
||||
tft->clear();
|
||||
if (settingsMap[displayBacklight] > 0)
|
||||
digitalWrite(settingsMap[displayBacklight], !TFT_BACKLIGHT_ON);
|
||||
#elif defined(ST7735_BL_V03)
|
||||
digitalWrite(ST7735_BL_V03, !TFT_BACKLIGHT_ON);
|
||||
#elif defined(ST7735_BL_V05)
|
||||
pinMode(ST7735_BL_V05, OUTPUT);
|
||||
digitalWrite(ST7735_BL_V05, !TFT_BACKLIGHT_ON);
|
||||
#elif defined(ST7735_BL)
|
||||
pinMode(ST7735_BL, OUTPUT);
|
||||
digitalWrite(ST7735_BL, !TFT_BACKLIGHT_ON);
|
||||
#elif !defined(RAK14014) && !defined(M5STACK) && !defined(UNPHONE)
|
||||
tft->sleep();
|
||||
tft->powerSaveOn();
|
||||
@ -720,11 +710,9 @@ bool TFTDisplay::connect()
|
||||
LOG_INFO("Power to TFT Backlight\n");
|
||||
#endif
|
||||
|
||||
#ifdef ST7735_BL_V03
|
||||
digitalWrite(ST7735_BL_V03, TFT_BACKLIGHT_ON);
|
||||
#elif defined(ST7735_BL_V05)
|
||||
pinMode(ST7735_BL_V05, OUTPUT);
|
||||
digitalWrite(ST7735_BL_V05, TFT_BACKLIGHT_ON);
|
||||
#ifdef ST7735_BL
|
||||
pinMode(ST7735_BL, OUTPUT);
|
||||
digitalWrite(ST7735_BL, TFT_BACKLIGHT_ON);
|
||||
#endif
|
||||
#ifdef UNPHONE
|
||||
unphone.backlight(true); // using unPhone library
|
||||
|
@ -280,15 +280,11 @@ void setup()
|
||||
|
||||
#if defined(VEXT_ENABLE_V03)
|
||||
pinMode(VEXT_ENABLE_V03, OUTPUT);
|
||||
pinMode(ST7735_BL_V03, OUTPUT);
|
||||
digitalWrite(VEXT_ENABLE_V03, 0); // turn on the display power and antenna boost
|
||||
digitalWrite(ST7735_BL_V03, 1); // display backligth on
|
||||
LOG_DEBUG("HELTEC Detect Tracker V1.0\n");
|
||||
#elif defined(VEXT_ENABLE_V05)
|
||||
pinMode(VEXT_ENABLE_V05, OUTPUT);
|
||||
pinMode(ST7735_BL_V05, OUTPUT);
|
||||
digitalWrite(VEXT_ENABLE_V05, 1); // turn on the lora antenna boost
|
||||
digitalWrite(ST7735_BL_V05, 1); // turn on display backligth
|
||||
LOG_DEBUG("HELTEC Detect Tracker V1.1\n");
|
||||
#elif defined(VEXT_ENABLE) && defined(VEXT_ON_VALUE)
|
||||
pinMode(VEXT_ENABLE, OUTPUT);
|
||||
@ -1149,4 +1145,4 @@ void loop()
|
||||
}
|
||||
// if (didWake) LOG_DEBUG("wake!\n");
|
||||
}
|
||||
#endif
|
||||
#endif
|
@ -250,7 +250,6 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false)
|
||||
digitalWrite(VEXT_ENABLE_V03, 1); // turn off the display power
|
||||
#elif defined(VEXT_ENABLE_V05)
|
||||
digitalWrite(VEXT_ENABLE_V05, 0); // turn off the lora amplifier power
|
||||
digitalWrite(ST7735_BL_V05, 0); // turn off the display power
|
||||
#elif defined(VEXT_ENABLE) && defined(VEXT_ON_VALUE)
|
||||
digitalWrite(VEXT_ENABLE, !VEXT_ON_VALUE); // turn on the display power
|
||||
#elif defined(VEXT_ENABLE)
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define ST7735_RESET 39
|
||||
#define ST7735_MISO -1
|
||||
#define ST7735_BUSY -1
|
||||
#define ST7735_BL_V05 21 /* V1.1 PCB marking */
|
||||
#define ST7735_BL 21 /* V1.1 PCB marking */
|
||||
#define ST7735_SPI_HOST SPI3_HOST
|
||||
#define SPI_FREQUENCY 40000000
|
||||
#define SPI_READ_FREQUENCY 16000000
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define ST7735_RESET 39
|
||||
#define ST7735_MISO -1
|
||||
#define ST7735_BUSY -1
|
||||
#define ST7735_BL_V03 45
|
||||
#define ST7735_BL 45
|
||||
#define ST7735_SPI_HOST SPI3_HOST
|
||||
#define SPI_FREQUENCY 40000000
|
||||
#define SPI_READ_FREQUENCY 16000000
|
||||
@ -69,4 +69,4 @@
|
||||
#define SX126X_RESET LORA_RESET
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
@ -17,7 +17,7 @@
|
||||
#define ST7735_RESET 39
|
||||
#define ST7735_MISO -1
|
||||
#define ST7735_BUSY -1
|
||||
#define ST7735_BL_V05 21 /* V1.1 PCB marking */
|
||||
#define ST7735_BL 21 /* V1.1 PCB marking */
|
||||
#define ST7735_SPI_HOST SPI3_HOST
|
||||
#define SPI_FREQUENCY 40000000
|
||||
#define SPI_READ_FREQUENCY 16000000
|
||||
|
@ -16,7 +16,7 @@
|
||||
#define ST7789_CS 38
|
||||
#define ST7789_RS 40
|
||||
#define ST7789_BL 21
|
||||
// P#define ST7735_BL_V05 21 /* V1.1 PCB marking */
|
||||
// P#define ST7735_BL 21 /* V1.1 PCB marking */
|
||||
|
||||
#define ST7789_RESET -1
|
||||
#define ST7789_MISO -1
|
||||
@ -41,7 +41,7 @@
|
||||
// #define ST7735_RESET 39
|
||||
// #define ST7735_MISO -1
|
||||
// #define ST7735_BUSY -1
|
||||
#define ST7735_BL_V05 21 /* V1.1 PCB marking */
|
||||
#define ST7735_BL 21 /* V1.1 PCB marking */
|
||||
// #define ST7735_SPI_HOST SPI3_HOST
|
||||
// #define SPI_FREQUENCY 40000000
|
||||
// #define SPI_READ_FREQUENCY 16000000
|
||||
|
@ -19,7 +19,7 @@
|
||||
// #define ST7735_RESET 39
|
||||
// #define ST7735_MISO -1
|
||||
// #define ST7735_BUSY -1
|
||||
#define ST7735_BL_V05 21 /* V1.1 PCB marking */
|
||||
#define ST7735_BL 21 /* V1.1 PCB marking */
|
||||
// #define ST7735_SPI_HOST SPI3_HOST
|
||||
// #define SPI_FREQUENCY 40000000
|
||||
// #define SPI_READ_FREQUENCY 16000000
|
||||
|
Loading…
Reference in New Issue
Block a user