mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-06 13:44:46 +00:00
Clear old lock-time prediction on triple press
This commit is contained in:
parent
059388694c
commit
1799f6cb0f
@ -783,7 +783,9 @@ void GPS::setGPSPower(bool on, bool standbyOnly, uint32_t sleepTime)
|
|||||||
// Record the current powerState
|
// Record the current powerState
|
||||||
if (on)
|
if (on)
|
||||||
powerState = GPS_ACTIVE;
|
powerState = GPS_ACTIVE;
|
||||||
else if (sleepTime <= GPS_IDLE_THRESHOLD_SECONDS * 1000UL && sleepTime > 0) // Note: sleepTime==0 if from GPS::disable()
|
else if (!enabled) // User has disabled with triple press
|
||||||
|
powerState = GPS_OFF;
|
||||||
|
else if (sleepTime <= GPS_IDLE_THRESHOLD_SECONDS * 1000UL)
|
||||||
powerState = GPS_IDLE;
|
powerState = GPS_IDLE;
|
||||||
else if (standbyOnly)
|
else if (standbyOnly)
|
||||||
powerState = GPS_STANDBY;
|
powerState = GPS_STANDBY;
|
||||||
@ -1664,6 +1666,10 @@ bool GPS::whileIdle()
|
|||||||
}
|
}
|
||||||
void GPS::enable()
|
void GPS::enable()
|
||||||
{
|
{
|
||||||
|
// Clear the old lock-time prediction
|
||||||
|
GPSCycles = 0;
|
||||||
|
averageLockTime = 0;
|
||||||
|
|
||||||
enabled = true;
|
enabled = true;
|
||||||
setInterval(GPS_THREAD_INTERVAL);
|
setInterval(GPS_THREAD_INTERVAL);
|
||||||
setAwake(true);
|
setAwake(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user