From ebe1b40bee4e7d4bcb332e91a5cb7f072ed2f662 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Mon, 9 Sep 2024 09:28:04 +0800 Subject: [PATCH] If GPS sleepTime is Zero, don't sleep. At the moment if the result of sleepTime calculations comes out to zero, we put the GPS into HARDSLEEP (losing all its status) and then immediately make it ACTIVE again. This patch avoids that toga. fixes https://github.com/meshtastic/firmware/issues/4657 --- src/gps/GPS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index b5e1991ae..46c76c4ae 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -1019,7 +1019,7 @@ void GPS::down() LOG_DEBUG("%us until next search\n", sleepTime / 1000); // If update interval less than 10 seconds, no attempt to sleep - if (updateInterval <= 10 * 1000UL) + if (updateInterval <= 10 * 1000UL || sleepTime == 0) setPowerState(GPS_IDLE); else {