mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
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
This commit is contained in:
parent
06ab9f7f6b
commit
8a9a0dca5f
2 changed files with 7 additions and 2 deletions
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue