hopefully fix remaining cppcheck issues (#9745)

This commit is contained in:
Thomas Göttgens
2026-02-25 10:27:21 +01:00
committed by GitHub
co-authored by GitHub
parent ad7d19c317
commit 54781cf51a
8 changed files with 17 additions and 14 deletions
@@ -297,7 +297,8 @@ int32_t EnvironmentTelemetryModule::runOnce()
// this only works on the wismesh hub with the solar option. This is not an I2C sensor, so we don't need the
// sensormap here.
#ifdef HAS_RAKPROT
result = rak9154Sensor.runOnce();
if (rak9154Sensor.hasSensor())
result = rak9154Sensor.runOnce();
#endif
#endif
}
@@ -567,9 +568,11 @@ bool EnvironmentTelemetryModule::getEnvironmentTelemetry(meshtastic_Telemetry *m
}
#endif
#ifdef HAS_RAKPROT
get_metrics = rak9154Sensor.getMetrics(m);
valid = valid || get_metrics;
hasSensor = true;
if (rak9154Sensor.hasSensor()) {
get_metrics = rak9154Sensor.getMetrics(m);
valid = valid || get_metrics;
hasSensor = true;
}
#endif
return valid && hasSensor;
}
@@ -18,6 +18,7 @@ class RAK9154Sensor : public TelemetrySensor, VoltageSensor, CurrentSensor
public:
RAK9154Sensor();
bool hasSensor() { return true; } // Not an I2C sensor; always available when HAS_RAKPROT is defined
virtual int32_t runOnce() override;
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
virtual uint16_t getBusVoltageMv() override;