From a788f16e91da9281ff8b3705fd3947babcdcd4ff Mon Sep 17 00:00:00 2001 From: code8buster Date: Thu, 15 Dec 2022 12:02:04 -0500 Subject: [PATCH] Potentially stop bad things happening on devices without a PMU --- src/sleep.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/sleep.cpp b/src/sleep.cpp index 46d14d623..72b7f7527 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -185,6 +185,18 @@ void doGPSpowersave(bool on) setGPSPower(0); } #endif + #ifdef PIN_GPS_WAKE + if (on) + { + DEBUG_MSG("Waking GPS"); + gps->forceWake(1); + } + else + { + DEBUG_MSG("GPS entering sleep"); + notifyGPSSleep.notifyObservers(NULL); + } + #endif } void doDeepSleep(uint64_t msecToWake)