Skip to content

Commit

Permalink
Update GPSUpdateScheduling.cpp (#5160)
Browse files Browse the repository at this point in the history
* Update GPSUpdateScheduling.cpp

Default value is too short, resulting in unstable GPS locks on T1000-E (possibly others). Fix has been tested an confirmed working with no adverse effects, by multiple users. Also discussed at length on Discord

* Coerce minimum instead of hardcode

* config

---------

Co-authored-by: Ben Meadors <[email protected]>
  • Loading branch information
spiffysec and thebentern authored Oct 28, 2024
1 parent c4eb9a6 commit 77dfc92
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gps/GPSUpdateScheduling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ bool GPSUpdateScheduling::isUpdateDue()
// Have we been searching for a GPS position for too long?
bool GPSUpdateScheduling::searchedTooLong()
{
uint32_t minimumOrConfiguredSecs = Default::getConfiguredOrMinimumValue(
config.position.position_broadcast_secs, default_broadcast_interval_secs);
uint32_t maxSearchMs =
Default::getConfiguredOrDefaultMs(config.position.position_broadcast_secs, default_broadcast_interval_secs);

Default::getConfiguredOrDefaultMs(minimumOrConfiguredSecs, default_broadcast_interval_secs);
// If broadcast interval set to max, no such thing as "too long"
if (maxSearchMs == UINT32_MAX)
return false;
Expand Down Expand Up @@ -115,4 +116,4 @@ void GPSUpdateScheduling::updateLockTimePrediction()
uint32_t GPSUpdateScheduling::predictedSearchDurationMs()
{
return GPSUpdateScheduling::predictedMsToGetLock;
}
}

0 comments on commit 77dfc92

Please sign in to comment.