Guard AirQuality I2C re-scan behind !MESHTASTIC_EXCLUDE_I2C
ScanI2CTwoWire is compiled out on builds that define MESHTASTIC_EXCLUDE_I2C (e.g. native-wasm/portduino), while the AirQuality module still builds there. Skip the re-scan when I2C is excluded; there is nothing to scan.
This commit is contained in:
@@ -142,9 +142,11 @@ int32_t AirQualityTelemetryModule::runOnce()
|
||||
if (moduleConfig.telemetry.air_quality_enabled) {
|
||||
LOG_INFO("Air quality Telemetry: init");
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_I2C
|
||||
// Re-scan I2C bus
|
||||
auto i2cScanner = std::unique_ptr<ScanI2CTwoWire>(new ScanI2CTwoWire());
|
||||
i2cScanFinished(i2cScanner.get());
|
||||
#endif
|
||||
|
||||
// check if we have at least one sensor
|
||||
if (!sensors.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user