From 83842e4b25adb28c30c5109d056a59eea716bff8 Mon Sep 17 00:00:00 2001 From: taco Date: Sat, 21 Jun 2025 10:09:28 +1000 Subject: [PATCH] fix: EnvironmentSensorManager.cpp: don't update location if GPS is turned off. previously the location would always snap to the last heard GPS location after GPS had been on. --- src/helpers/sensors/EnvironmentSensorManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/sensors/EnvironmentSensorManager.cpp b/src/helpers/sensors/EnvironmentSensorManager.cpp index dda1fd55..ed20b8a4 100644 --- a/src/helpers/sensors/EnvironmentSensorManager.cpp +++ b/src/helpers/sensors/EnvironmentSensorManager.cpp @@ -220,7 +220,7 @@ void EnvironmentSensorManager::loop() { _location->loop(); if (millis() > next_gps_update) { - if (_location->isValid()) { + if (gps_active && _location->isValid()) { node_lat = ((double)_location->getLatitude())/1000000.; node_lon = ((double)_location->getLongitude())/1000000.; MESH_DEBUG_PRINTLN("lat %f lon %f", node_lat, node_lon);