Minor change for SEN5X detection

This commit is contained in:
oscgonfer 2025-07-15 19:53:20 +02:00
parent 551629b5df
commit 861308e7e7

View File

@ -196,7 +196,6 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
DeviceAddress addr(port, 0x00); DeviceAddress addr(port, 0x00);
uint16_t registerValue = 0x00; uint16_t registerValue = 0x00;
String prod = "";
ScanI2C::DeviceType type; ScanI2C::DeviceType type;
TwoWire *i2cBus; TwoWire *i2cBus;
#ifdef RV3028_RTC #ifdef RV3028_RTC
@ -539,12 +538,13 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
case ICM20948_ADDR_ALT: // same as MPU6050_ADDR case ICM20948_ADDR_ALT: // same as MPU6050_ADDR
// ICM20948 Register check // ICM20948 Register check
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1); registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1);
prod = readSEN5xProductName(i2cBus, addr.address);
if (registerValue == 0xEA) { if (registerValue == 0xEA) {
type = ICM20948; type = ICM20948;
logFoundDevice("ICM20948", (uint8_t)addr.address); logFoundDevice("ICM20948", (uint8_t)addr.address);
break; break;
} else { } else {
String prod = "";
prod = readSEN5xProductName(i2cBus, addr.address);
if (prod.startsWith("SEN55")) { if (prod.startsWith("SEN55")) {
type = SEN5X; type = SEN5X;
logFoundDevice("Sensirion SEN55", addr.address); logFoundDevice("Sensirion SEN55", addr.address);