Remove all sorts of redundant VEXT_ENABLE ifdefs

This commit is contained in:
Kevin Hester 2024-08-22 09:28:41 -07:00
parent 3ae8aadaf0
commit 5ccb6df142
8 changed files with 14 additions and 38 deletions

View File

@ -581,10 +581,6 @@ void TFTDisplay::sendCommand(uint8_t com)
tft->powerSaveOff();
#endif
#ifdef VTFT_CTRL_V03
digitalWrite(VTFT_CTRL_V03, LOW);
#endif
#ifdef VTFT_CTRL
digitalWrite(VTFT_CTRL, LOW);
#endif
@ -610,9 +606,6 @@ void TFTDisplay::sendCommand(uint8_t com)
tft->powerSaveOn();
#endif
#ifdef VTFT_CTRL_V03
digitalWrite(VTFT_CTRL_V03, HIGH);
#endif
#ifdef VTFT_CTRL
digitalWrite(VTFT_CTRL, HIGH);
#endif

View File

@ -278,25 +278,9 @@ void setup()
digitalWrite(LORA_TCXO_GPIO, HIGH);
#endif
#if defined(VEXT_ENABLE_V03)
pinMode(VEXT_ENABLE_V03, OUTPUT);
digitalWrite(VEXT_ENABLE_V03, 0); // turn on the display power and antenna boost
LOG_DEBUG("HELTEC Detect Tracker V1.0\n");
#elif defined(VEXT_ENABLE_V05)
pinMode(VEXT_ENABLE_V05, OUTPUT);
digitalWrite(VEXT_ENABLE_V05, 1); // turn on the lora antenna boost
LOG_DEBUG("HELTEC Detect Tracker V1.1\n");
#elif defined(VEXT_ENABLE) && defined(VEXT_ON_VALUE)
#if defined(VEXT_ENABLE)
pinMode(VEXT_ENABLE, OUTPUT);
digitalWrite(VEXT_ENABLE, VEXT_ON_VALUE); // turn on the display power
#elif defined(VEXT_ENABLE)
pinMode(VEXT_ENABLE, OUTPUT);
digitalWrite(VEXT_ENABLE, 0); // turn on the display power
#endif
#if defined(VTFT_CTRL_V03)
pinMode(VTFT_CTRL_V03, OUTPUT);
digitalWrite(VTFT_CTRL_V03, LOW);
#endif
#if defined(VTFT_CTRL)

View File

@ -246,14 +246,8 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false)
digitalWrite(RESET_OLED, 1); // put the display in reset before killing its power
#endif
#if defined(VEXT_ENABLE_V03)
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
#elif defined(VEXT_ENABLE) && defined(VEXT_ON_VALUE)
#if defined(VEXT_ENABLE)
digitalWrite(VEXT_ENABLE, !VEXT_ON_VALUE); // turn on the display power
#elif defined(VEXT_ENABLE)
digitalWrite(VEXT_ENABLE, 1); // turn off the display power
#endif
#ifdef ARCH_ESP32

View File

@ -31,7 +31,8 @@
// GPS UC6580: GPS V_DET(8), VDD_IO(7), DCDC_IN(21), pulls up RESETN(17), D_SEL(33) and BOOT_MODE(34) through 10kR
// GPS LNA SW7125DE: VCC(4), pulls up SHDN(5) through 10kR
// LED: VDD, LEDA (through diode)
#define VEXT_ENABLE_V05 3 // active HIGH - powers the GPS, GPS LNA and OLED VDD/anode
#define VEXT_ENABLE 3 // active HIGH - powers the GPS, GPS LNA and OLED VDD/anode
#define VEXT_ON_VALUE HIGH
#define BUTTON_PIN 0
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage

View File

@ -24,11 +24,12 @@
#define TFT_WIDTH DISPLAY_HEIGHT
#define TFT_OFFSET_X 26
#define TFT_OFFSET_Y -1
#define VTFT_CTRL_V03 46 // Heltec Tracker needs this pulled low for TFT
#define VTFT_CTRL 46 // Heltec Tracker needs this pulled low for TFT
#define SCREEN_TRANSITION_FRAMERATE 3 // fps
#define DISPLAY_FORCE_SMALL_FONTS
#define VEXT_ENABLE_V03 Vext // active low, powers the oled display and the lora antenna boost
#define VEXT_ENABLE Vext // active low, powers the oled display and the lora antenna boost
#define VEXT_ON_VALUE LOW
#define BUTTON_PIN 0
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage

View File

@ -29,7 +29,8 @@
#define SCREEN_TRANSITION_FRAMERATE 3 // fps
#define DISPLAY_FORCE_SMALL_FONTS
#define VEXT_ENABLE_V05 3 // active HIGH, powers the lora antenna boost
#define VEXT_ENABLE 3 // active HIGH, powers the lora antenna boost
#define VEXT_ON_VALUE HIGH
#define BUTTON_PIN 0
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage

View File

@ -53,7 +53,8 @@
#define SCREEN_TRANSITION_FRAMERATE 3 // fps
// #define DISPLAY_FORCE_SMALL_FONTS
#define VEXT_ENABLE_V05 3 // active HIGH, powers the lora antenna boost
#define VEXT_ENABLE 3 // active HIGH, powers the lora antenna boost
#define VEXT_ON_VALUE HIGH
#define BUTTON_PIN 0
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage

View File

@ -31,7 +31,8 @@
#define SCREEN_TRANSITION_FRAMERATE 3 // fps
// #define DISPLAY_FORCE_SMALL_FONTS
#define VEXT_ENABLE_V05 3 // active HIGH, powers the lora antenna boost
#define VEXT_ENABLE 3 // active HIGH, powers the lora antenna boost
#define VEXT_ON_VALUE HIGH
#define BUTTON_PIN 0
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
@ -90,4 +91,4 @@
{ \
26, 37, 17, 16, 15, 7 \
}
// #end keyboard
// #end keyboard