From 5995c7060ddec524ec8dc1218763d0da1d2a8b2e Mon Sep 17 00:00:00 2001 From: tropho23 <71199294+tropho23@users.noreply.github.com> Date: Mon, 17 Jul 2023 19:55:40 -0400 Subject: [PATCH] Added triple-press GPS toggle button changes for select ESP32 devices (#2617) * Added triple-press GPS toggle button changes * Revert edits to extensions.json * comma'd --------- Co-authored-by: Ben Meadors Co-authored-by: code8buster --- variants/heltec_v2.1/platformio.ini | 3 ++- variants/heltec_v2.1/variant.h | 2 ++ variants/tlora_t3s3_v1/platformio.ini | 3 ++- variants/tlora_t3s3_v1/variant.h | 2 ++ variants/tlora_v2_1_16/platformio.ini | 3 ++- variants/tlora_v2_1_16/variant.h | 2 ++ 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/variants/heltec_v2.1/platformio.ini b/variants/heltec_v2.1/platformio.ini index 29f544f7a..7d4daecc9 100644 --- a/variants/heltec_v2.1/platformio.ini +++ b/variants/heltec_v2.1/platformio.ini @@ -4,4 +4,5 @@ extends = esp32_base board = heltec_wifi_lora_32_V2 board_level = extra build_flags = - ${esp32_base.build_flags} -D HELTEC_V2_1 -I variants/heltec_v2.1 \ No newline at end of file + ${esp32_base.build_flags} -D HELTEC_V2_1 -I variants/heltec_v2.1 + -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. \ No newline at end of file diff --git a/variants/heltec_v2.1/variant.h b/variants/heltec_v2.1/variant.h index e7cfd5b34..ed123efec 100644 --- a/variants/heltec_v2.1/variant.h +++ b/variants/heltec_v2.1/variant.h @@ -8,6 +8,8 @@ #define GPS_RX_PIN 36 #define GPS_TX_PIN 33 +#define PIN_GPS_EN 37 // GPS power enable pin + #ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag #define I2C_SDA 4 // I2C pins for this board #define I2C_SCL 15 diff --git a/variants/tlora_t3s3_v1/platformio.ini b/variants/tlora_t3s3_v1/platformio.ini index bef57c3b4..fd3d393d9 100644 --- a/variants/tlora_t3s3_v1/platformio.ini +++ b/variants/tlora_t3s3_v1/platformio.ini @@ -4,4 +4,5 @@ board = tlora-t3s3-v1 upload_protocol = esp-builtin build_flags = - ${esp32_base.build_flags} -D TLORA_T3S3_V1 -I variants/tlora_t3s3_v1 \ No newline at end of file + ${esp32_base.build_flags} -D TLORA_T3S3_V1 -I variants/tlora_t3s3_v1 + -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. \ No newline at end of file diff --git a/variants/tlora_t3s3_v1/variant.h b/variants/tlora_t3s3_v1/variant.h index 313b08e6d..7f914c055 100644 --- a/variants/tlora_t3s3_v1/variant.h +++ b/variants/tlora_t3s3_v1/variant.h @@ -1,6 +1,8 @@ #undef GPS_RX_PIN #undef GPS_TX_PIN +#define PIN_GPS_EN 42 // GPS power enable pin + #define HAS_SDCARD #define SDCARD_USE_SPI1 diff --git a/variants/tlora_v2_1_16/platformio.ini b/variants/tlora_v2_1_16/platformio.ini index da2a32ce4..167f6c37c 100644 --- a/variants/tlora_v2_1_16/platformio.ini +++ b/variants/tlora_v2_1_16/platformio.ini @@ -2,4 +2,5 @@ extends = esp32_base board = ttgo-lora32-v21 build_flags = - ${esp32_base.build_flags} -D TLORA_V2_1_16 -I variants/tlora_v2_1_16 \ No newline at end of file + ${esp32_base.build_flags} -D TLORA_V2_1_16 -I variants/tlora_v2_1_16 + -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. \ No newline at end of file diff --git a/variants/tlora_v2_1_16/variant.h b/variants/tlora_v2_1_16/variant.h index adb5af898..30a176e4c 100644 --- a/variants/tlora_v2_1_16/variant.h +++ b/variants/tlora_v2_1_16/variant.h @@ -3,6 +3,8 @@ #define GPS_RX_PIN 15 // per @der_bear on the forum, 36 is incorrect for this board type and 15 is a better pick #define GPS_TX_PIN 13 +#define PIN_GPS_EN 19 // GPS power enable pin + #define BATTERY_PIN 35 #define ADC_CHANNEL ADC1_GPIO35_CHANNEL #define BATTERY_SENSE_SAMPLES 30