mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-01 01:36:12 +00:00
fix(power): power off GPS before SYSTEMOFF to prevent battery drain on shutdown
NRF52 GPIO pins retain their last state in SYSTEMOFF. If GPS was active, PIN_GPS_EN stays HIGH and the module keeps drawing ~20mA. gps_enabled is already persisted to flash so applyGpsPrefs() restores the correct state on next boot. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
2c847c996f
commit
6c5a40a8ce
@@ -1519,6 +1519,13 @@ void UITask::shutdown(bool restart){
|
|||||||
} else {
|
} else {
|
||||||
_display->turnOff();
|
_display->turnOff();
|
||||||
radio_driver.powerOff();
|
radio_driver.powerOff();
|
||||||
|
#ifdef PIN_GPS_EN
|
||||||
|
// Power off GPS before SYSTEMOFF — GPIO pins retain state in NRF52 SYSTEMOFF,
|
||||||
|
// so without this the GPS stays powered and drains the battery.
|
||||||
|
// gps_enabled is already persisted to flash; applyGpsPrefs() restores it on next boot.
|
||||||
|
pinMode(PIN_GPS_EN, OUTPUT);
|
||||||
|
digitalWrite(PIN_GPS_EN, LOW);
|
||||||
|
#endif
|
||||||
_board->powerOff();
|
_board->powerOff();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user