From 85f8179aaf573da9df64e8f3000b2b38b0f911c1 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 24 Apr 2026 19:50:48 -0500 Subject: [PATCH] Add search duration check for exceeding 15 minutes Added a condition to check if the search duration exceeds 15 minutes, indicating too long of a search. --- src/gps/GPSUpdateScheduling.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gps/GPSUpdateScheduling.cpp b/src/gps/GPSUpdateScheduling.cpp index 5eaf7a8ba..1056699cf 100644 --- a/src/gps/GPSUpdateScheduling.cpp +++ b/src/gps/GPSUpdateScheduling.cpp @@ -81,6 +81,10 @@ bool GPSUpdateScheduling::searchedTooLong() else if (elapsedSearchMs() > maxSearchMs) return true; + // Anything over 15 minutes is too long. TODO: Make a smarter algorithm that backs off the search dwell time when not getting a lock. + else if (elapsedSearchMs() > 1000 * 60 * 15) + return true; + // Otherwise, not too long yet! else return false;