From c9398cccaa079729acbd758b359d7fc8f34923a2 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 13 Jun 2026 12:04:41 -0500 Subject: [PATCH] Use standard GPS enable pin, for smarter power control on M3 (#10671) * Use standard GPS enable pin, for smarter power control on M3 * Enable GPS pin in variant.cpp initialization --------- Co-authored-by: Ben Meadors --- variants/nrf52840/ELECROW-ThinkNode-M3/variant.cpp | 9 ++++----- variants/nrf52840/ELECROW-ThinkNode-M3/variant.h | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/variants/nrf52840/ELECROW-ThinkNode-M3/variant.cpp b/variants/nrf52840/ELECROW-ThinkNode-M3/variant.cpp index 45a64ad3b..732ac77fa 100644 --- a/variants/nrf52840/ELECROW-ThinkNode-M3/variant.cpp +++ b/variants/nrf52840/ELECROW-ThinkNode-M3/variant.cpp @@ -56,8 +56,8 @@ void initVariant() digitalWrite(DHT_POWER, HIGH); pinMode(Battery_POWER, OUTPUT); digitalWrite(Battery_POWER, HIGH); - pinMode(GPS_POWER, OUTPUT); - digitalWrite(GPS_POWER, HIGH); + pinMode(PIN_GPS_EN, OUTPUT); + digitalWrite(PIN_GPS_EN, HIGH); } // called from main-nrf52.cpp during the cpuDeepSleep() function @@ -74,12 +74,11 @@ void variant_shutdown() digitalWrite(DHT_POWER, LOW); digitalWrite(ACC_POWER, LOW); digitalWrite(Battery_POWER, LOW); - digitalWrite(GPS_POWER, LOW); // This sets the pin to OUTPUT and LOW for the pins *not* in the if block. for (int pin = 0; pin < 48; pin++) { if (pin == PIN_POWER_USB || pin == BUTTON_PIN || pin == PIN_EN1 || pin == PIN_EN2 || pin == DHT_POWER || - pin == ACC_POWER || pin == Battery_POWER || pin == GPS_POWER || pin == LR1110_SPI_MISO_PIN || + pin == ACC_POWER || pin == Battery_POWER || pin == PIN_GPS_EN || pin == LR1110_SPI_MISO_PIN || pin == LR1110_SPI_MOSI_PIN || pin == LR1110_SPI_SCK_PIN || pin == LR1110_SPI_NSS_PIN || pin == LR1110_BUSY_PIN || pin == LR1110_NRESET_PIN || pin == LR1110_IRQ_PIN || pin == GPS_TX_PIN || pin == GPS_RX_PIN || pin == LED_GREEN || pin == LED_RED || pin == LED_BLUE) { @@ -101,4 +100,4 @@ void variant_shutdown() nrf_gpio_cfg_input(PIN_POWER_USB, NRF_GPIO_PIN_PULLDOWN); // Configure the pin to be woken up as an input nrf_gpio_pin_sense_t sense2 = NRF_GPIO_PIN_SENSE_HIGH; nrf_gpio_cfg_sense_set(PIN_POWER_USB, sense2); -} \ No newline at end of file +} diff --git a/variants/nrf52840/ELECROW-ThinkNode-M3/variant.h b/variants/nrf52840/ELECROW-ThinkNode-M3/variant.h index fa127ae3e..bd5bae9c8 100644 --- a/variants/nrf52840/ELECROW-ThinkNode-M3/variant.h +++ b/variants/nrf52840/ELECROW-ThinkNode-M3/variant.h @@ -37,7 +37,8 @@ extern "C" { // Power Pin #define NRF_APM -#define GPS_POWER 14 +#define PIN_GPS_EN 14 +#define GPS_EN_ACTIVE HIGH #define PIN_POWER_USB 31 #define EXT_PWR_DETECT PIN_POWER_USB #define PIN_POWER_DONE 24