Skip to content

Commit d7ad890

Browse files
authored
Merge pull request #1633 from weebl2000/fix/gps-uart-power-leak
Fix GPS UART consuming +8mA when disabled (nRF52)
2 parents 67779ad + 8a9a0dc commit d7ad890

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/helpers/sensors/EnvironmentSensorManager.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,9 @@ void EnvironmentSensorManager::loop() {
707707
static long next_gps_update = 0;
708708

709709
#if ENV_INCLUDE_GPS
710-
_location->loop();
710+
if (gps_active) {
711+
_location->loop();
712+
}
711713
if (millis() > next_gps_update) {
712714

713715
if(gps_active){

src/helpers/sensors/MicroNMEALocationProvider.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ public :
7979
if (_pin_en != -1) {
8080
digitalWrite(_pin_en, !PIN_GPS_EN_ACTIVE);
8181
}
82-
if (_peripher_power) _peripher_power->release();
82+
if (_pin_reset != -1) {
83+
digitalWrite(_pin_reset, GPS_RESET_FORCE);
84+
}
85+
if (_peripher_power) _peripher_power->release();
8386
}
8487

8588
bool isEnabled() override {

0 commit comments

Comments
 (0)