Reduce overhead in SEN5X probing

This commit is contained in:
oscgonfer
2026-06-14 14:48:40 +02:00
parent fc5dc5fc90
commit f604a4e172
2 changed files with 2 additions and 10 deletions
+1 -1
View File
@@ -140,7 +140,7 @@ bool ScanI2CTwoWire::i2cCommandResponseLength(ScanI2C::DeviceAddress addr, uint1
#include "../modules/Telemetry/Sensor/SEN5XSensor.h"
bool probeSEN5X(TwoWire *i2cBus, uint8_t address, ScanI2C::I2CPort port)
{
SEN5XSensor sen5xsensor = SEN5XSensor();
SEN5XSensor sen5xsensor;
return sen5xsensor.probe(i2cBus, address, port);
}
#endif
+1 -9
View File
@@ -86,16 +86,8 @@ bool SEN5XSensor::probe(TwoWire *bus, uint8_t address, ScanI2C::I2CPort port)
reClockI2C.setup(_bus, _port);
#endif /* SEN5X_I2C_CLOCK_SPEED */
delay(50); // without this there is an error on the deviceReset function
if (!sendCommand(SEN5X_RESET)) {
LOG_ERROR("SEN5X: error resetting device");
return false;
}
delay(200); // From Sensirion Datasheet
if (!findModel()) {
LOG_ERROR("SEN5X: error finding sensor model");
LOG_DEBUG("SEN5X: can't find SEN5X model");
return false;
}
return true;