From 4a534f02a48626f2addf742dced2f9e8321d5e16 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 19 Mar 2026 15:27:59 -0500 Subject: [PATCH] fix(gps): prevent GPS re-enablement in NOT_PRESENT mode --- src/gps/GPS.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 1260d8b15..cf5511a33 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -103,6 +103,14 @@ static int32_t gpsSwitch() if (gps) { int currentState = digitalRead(PIN_GPS_SWITCH); + // Respect explicit NOT_PRESENT mode and do not let the hardware switch re-enable GPS. + if (config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT) { + gps->disable(); + lastState = currentState; + firstrun = false; + return 1000; + } + // if the switch is set to zero, disable the GPS Thread if (firstrun) if (currentState == LOW)