Skip to content

Commit 485749a

Browse files
authored
Merge pull request #430 from oltaco/gps-update-fix
fix: EnvironmentSensorManager.cpp: don't update location if GPS is turned off
2 parents 8090992 + 83842e4 commit 485749a

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)