Skip to content

Commit 83842e4

Browse files
committed
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.
1 parent 7f0f3b7 commit 83842e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/helpers/sensors/EnvironmentSensorManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void EnvironmentSensorManager::loop() {
220220
_location->loop();
221221

222222
if (millis() > next_gps_update) {
223-
if (_location->isValid()) {
223+
if (gps_active && _location->isValid()) {
224224
node_lat = ((double)_location->getLatitude())/1000000.;
225225
node_lon = ((double)_location->getLongitude())/1000000.;
226226
MESH_DEBUG_PRINTLN("lat %f lon %f", node_lat, node_lon);

0 commit comments

Comments
 (0)