Skip to content

Commit

Permalink
Check if hasSensor an run if not initialized (#2613)
Browse files Browse the repository at this point in the history
  • Loading branch information
thebentern committed Jul 16, 2023
1 parent 6d97d5d commit e4e26a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/Telemetry/EnvironmentTelemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ int32_t EnvironmentTelemetryModule::runOnce()
result = lps22hbSensor.runOnce();
if (sht31Sensor.hasSensor())
result = sht31Sensor.runOnce();
if (ina219Sensor.hasSensor() && !ina219Sensor.isInitialized())
result = ina219Sensor.runOnce();
if (ina260Sensor.hasSensor() && !ina260Sensor.isInitialized())
result = ina260Sensor.runOnce();
}
return result;
} else {
Expand Down

0 comments on commit e4e26a8

Please sign in to comment.