mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-13 16:55:08 +00:00
gps: don't stop lock attempts just because the main cpu is sleeping
This commit is contained in:
parent
1a3cc40c7e
commit
62c228b986
@ -151,7 +151,7 @@ uint32_t GPS::getWakeTime() const
|
|||||||
return t; // already maxint
|
return t; // already maxint
|
||||||
|
|
||||||
if (t == 0)
|
if (t == 0)
|
||||||
t = 5 * 60; // Allow up to 5 mins for each attempt (probably will be much less if we can find sats)
|
t = 15 * 60; // Allow up to 5 mins for each attempt (probably will be much less if we can find sats)
|
||||||
|
|
||||||
t *= 1000; // msecs
|
t *= 1000; // msecs
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ void GPS::loop()
|
|||||||
// While we are awake
|
// While we are awake
|
||||||
if (isAwake) {
|
if (isAwake) {
|
||||||
// DEBUG_MSG("looking for location\n");
|
// DEBUG_MSG("looking for location\n");
|
||||||
if ((now - lastWhileActiveMsec) > 1000) {
|
if ((now - lastWhileActiveMsec) > 5000) {
|
||||||
lastWhileActiveMsec = now;
|
lastWhileActiveMsec = now;
|
||||||
whileActive();
|
whileActive();
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ void GPS::loop()
|
|||||||
// Once we get a location we no longer desperately want an update
|
// Once we get a location we no longer desperately want an update
|
||||||
// or if we got a time and we are in GpsOpTimeOnly mode
|
// or if we got a time and we are in GpsOpTimeOnly mode
|
||||||
// DEBUG_MSG("gotLoc %d, tooLong %d, gotTime %d\n", gotLoc, tooLong, gotTime);
|
// DEBUG_MSG("gotLoc %d, tooLong %d, gotTime %d\n", gotLoc, tooLong, gotTime);
|
||||||
if (gotLoc || tooLong || (gotTime && getGpsOp() == GpsOperation_GpsOpTimeOnly)) {
|
if ((gotLoc && timeSetFromGPS) || tooLong || (gotTime && getGpsOp() == GpsOperation_GpsOpTimeOnly)) {
|
||||||
if (gotLoc)
|
if (gotLoc)
|
||||||
hasValidLocation = true;
|
hasValidLocation = true;
|
||||||
|
|
||||||
@ -247,7 +247,10 @@ void GPS::forceWake(bool on)
|
|||||||
wakeAllowed = true;
|
wakeAllowed = true;
|
||||||
} else {
|
} else {
|
||||||
wakeAllowed = false;
|
wakeAllowed = false;
|
||||||
setAwake(false);
|
|
||||||
|
// Note: if the gps was already awake, we DO NOT shut it down, because we want to allow it to complete its lock
|
||||||
|
// attempt even if we are in light sleep. Once the attempt succeeds (or times out) we'll then shut it down.
|
||||||
|
// setAwake(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user