Add informSearchFailed method to update GPS power state handling (#10394)

This commit is contained in:
Ben Meadors
2026-05-05 10:12:50 -05:00
committed by GitHub
parent d559af8477
commit 603cce2988
3 changed files with 17 additions and 3 deletions
+5 -2
View File
@@ -1017,10 +1017,13 @@ void GPS::up()
setPowerState(GPS_ACTIVE);
}
// We've got a GPS lock. Enter a low power state, potentially.
// We've finished a GPS search cycle (lock or timeout). Enter a low power state, potentially.
void GPS::down()
{
scheduling.informGotLock();
if (hasValidLocation)
scheduling.informGotLock();
else
scheduling.informSearchFailed();
uint32_t predictedSearchDuration = scheduling.predictedSearchDurationMs();
uint32_t sleepTime = scheduling.msUntilNextSearch();
uint32_t updateInterval = Default::getConfiguredOrDefaultMs(config.position.gps_update_interval);