Adds a flag to turn the GPS power rail off entirely on tbeam

This commit is contained in:
code8buster
2022-12-04 01:57:00 -05:00
parent b1f3e117d1
commit 911083c49d
6 changed files with 36 additions and 5 deletions

View File

@@ -167,6 +167,22 @@ static void waitEnterSleep()
notifySleep.notifyObservers(NULL);
}
void doGPSpowersave(bool on)
{
if (on)
{
DEBUG_MSG("Turning GPS back on\n");
gps->forceWake(1);
setGPSPower(1);
}
else
{
DEBUG_MSG("Turning off GPS chip\n");
notifySleep.notifyObservers(NULL);
setGPSPower(0);
}
}
void doDeepSleep(uint64_t msecToWake)
{
DEBUG_MSG("Entering deep sleep for %lu seconds\n", msecToWake / 1000);