mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-14 23:41:29 +10:00
Merge pull request #10715 from fablabbcn/bugfix/detection-on-0x69-address
Fixes on 0x69 address detection
This commit is contained in:
@@ -39,4 +39,4 @@ class PMSA003ISensor : public TelemetrySensor
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -52,4 +52,4 @@ class SCD30Sensor : public TelemetrySensor
|
||||
meshtastic_AdminMessage *response) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -62,4 +62,4 @@ class SCD4XSensor : public TelemetrySensor
|
||||
meshtastic_AdminMessage *response) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -75,6 +75,24 @@ bool SEN5XSensor::findModel()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SEN5XSensor::probe(TwoWire *bus, uint8_t address, ScanI2C::I2CPort port)
|
||||
{
|
||||
LOG_INFO("SEN5X: probing sensor");
|
||||
|
||||
_bus = bus;
|
||||
_address = address;
|
||||
#ifdef SEN5X_I2C_CLOCK_SPEED
|
||||
_port = port;
|
||||
reClockI2C.setup(_bus, _port);
|
||||
#endif /* SEN5X_I2C_CLOCK_SPEED */
|
||||
|
||||
if (!findModel()) {
|
||||
LOG_DEBUG("SEN5X: can't find SEN5X model");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SEN5XSensor::sendCommand(uint16_t command)
|
||||
{
|
||||
uint8_t nothing;
|
||||
|
||||
@@ -155,6 +155,7 @@ See: https://sensirion.com/resource/application_note/low_power_mode/sen5x
|
||||
|
||||
public:
|
||||
SEN5XSensor();
|
||||
bool probe(TwoWire *bus, uint8_t address, ScanI2C::I2CPort port);
|
||||
virtual bool initDevice(TwoWire *bus, ScanI2C::FoundDevice *dev) override;
|
||||
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
||||
|
||||
@@ -169,4 +170,4 @@ See: https://sensirion.com/resource/application_note/low_power_mode/sen5x
|
||||
meshtastic_AdminMessage *response) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user