Browse Source

Fix GPS +8mA power leak when disabled (nRF52)

On the T114, GPS_RESET (pin 38) is the same pin as PIN_3V3_EN.
MicroNMEALocationProvider::begin() sets pin 38 HIGH (powering the 3V3
rail) but stop() never set it back LOW, leaving the GPS module powered
even when disabled.

Assert reset pin in stop() to mirror begin(), and guard
_location->loop() behind gps_active check.

Fixes meshcore-dev/MeshCore#1628
pull/1633/head
Wessel Nieboer 4 months ago
committed by Wessel Nieboer
parent
commit
8a9a0dca5f
No known key found for this signature in database GPG Key ID: 27BB1C3D63DEEFFF
  1. 4
      src/helpers/sensors/EnvironmentSensorManager.cpp
  2. 5
      src/helpers/sensors/MicroNMEALocationProvider.h

4
src/helpers/sensors/EnvironmentSensorManager.cpp

@ -707,7 +707,9 @@ void EnvironmentSensorManager::loop() {
static long next_gps_update = 0;
#if ENV_INCLUDE_GPS
_location->loop();
if (gps_active) {
_location->loop();
}
if (millis() > next_gps_update) {
if(gps_active){

5
src/helpers/sensors/MicroNMEALocationProvider.h

@ -79,7 +79,10 @@ public :
if (_pin_en != -1) {
digitalWrite(_pin_en, !PIN_GPS_EN_ACTIVE);
}
if (_peripher_power) _peripher_power->release();
if (_pin_reset != -1) {
digitalWrite(_pin_reset, GPS_RESET_FORCE);
}
if (_peripher_power) _peripher_power->release();
}
bool isEnabled() override {

Loading…
Cancel
Save