bug #376 wip - we now kill gps power when it is supposed to be asleep

This commit is contained in:
Kevin Hester
2020-10-05 15:29:26 +08:00
parent b072eec4ac
commit 3c1c11e439
7 changed files with 69 additions and 60 deletions

View File

@@ -95,9 +95,13 @@ uint32_t getValidTime()
bool GPS::setup()
{
notifySleepObserver.observe(&notifySleep);
setAwake(true); // Wake GPS power before doing any init
bool ok = setupGPS();
return true;
if (ok)
notifySleepObserver.observe(&notifySleep);
return ok;
}
/**
@@ -175,7 +179,6 @@ void GPS::loop()
// If we are overdue for an update, turn on the GPS and at least publish the current status
uint32_t now = millis();
bool mustPublishUpdate = false;
if ((now - lastSleepStartMsec) > getSleepTime() && !isAwake) {
// We now want to be awake - so wake up the GPS