Update GPSUpdateScheduling.cpp (#5160)

* 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 <benmmeadors@gmail.com>
This commit is contained in:
Spiffysec 2024-10-28 12:18:03 +01:00 committed by GitHub
parent c4eb9a6d7f
commit 77dfc92f1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
@ -115,4 +116,4 @@ void GPSUpdateScheduling::updateLockTimePrediction()
uint32_t GPSUpdateScheduling::predictedSearchDurationMs()
{
return GPSUpdateScheduling::predictedMsToGetLock;
}
}