diff --git a/src/hal/ttgofox.h b/src/hal/ttgofox.h index b1790583..2ecb493e 100644 --- a/src/hal/ttgofox.h +++ b/src/hal/ttgofox.h @@ -9,8 +9,9 @@ #define CFG_sx1276_radio 1 // HPD13A LoRa SoC #define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C -#define HAS_LED NOT_A_PIN // green on board LED is useless, is GPIO25, but also switching Power for Lora+Display +#define HAS_LED NOT_A_PIN // green on board LED is useless, is GPIO25, which switches power for Lora+Display //#define LED_ACTIVE_LOW 1 // Onboard LED is active when pin is LOW +#define HAS_LOWPOWER_SWITCH GPIO_NUM_25 // switches power for LoRa chip + display (0 = off / 1 = on) #define HAS_BATTERY_PROBE ADC1_GPIO35_CHANNEL #define BATT_FACTOR 2 // voltage divider 100k/100k on board #define HAS_BUTTON GPIO_NUM_36 // on board button (next to reset) diff --git a/src/main.cpp b/src/main.cpp index c5844dc9..8e6ca3d4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -147,6 +147,13 @@ void setup() { strcat_P(features, " PSRAM"); #endif +// set low power mode to off +#ifdef HAS_LOWPOWER_SWITCH + pinMode(HAS_LED, OUTPUT); + digitalWrite(HAS_LOWPOWER_SWITCH, HIGH); + strcat_P(features, " LPWR"); +#endif + // initialize leds #if (HAS_LED != NOT_A_PIN) pinMode(HAS_LED, OUTPUT);