diff --git a/src/detect/ScanI2C.cpp b/src/detect/ScanI2C.cpp index aa25ab5e1..a147194a7 100644 --- a/src/detect/ScanI2C.cpp +++ b/src/detect/ScanI2C.cpp @@ -37,15 +37,15 @@ ScanI2C::FoundDevice ScanI2C::firstKeyboard() const ScanI2C::FoundDevice ScanI2C::firstAccelerometer() const { - ScanI2C::DeviceType types[] = {MPU6050, LIS3DH, BMA423, LSM6DS3, BMX160, STK8BAXX, - ICM20948, QMA6100P, BMM150, BMI270, ICM42607P}; - return firstOfOrNONE(11, types); + ScanI2C::DeviceType types[] = {MPU6050, LIS3DH, BMA423, LSM6DS3, BMX160, STK8BAXX, + ICM20948, QMA6100P, BMM150, BMI270, ICM42607P, ISM330DHCX}; + return firstOfOrNONE(12, types); } ScanI2C::FoundDevice ScanI2C::firstMagnetometer() const { - ScanI2C::DeviceType types[] = {MMC5983MA}; - return firstOfOrNONE(1, types); + ScanI2C::DeviceType types[] = {MMC5983MA, IIS2MDCTR}; + return firstOfOrNONE(2, types); } ScanI2C::FoundDevice ScanI2C::firstAQI() const diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index 7c4f2f0e3..2333601f7 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -99,6 +99,8 @@ class ScanI2C CW2015, SCD30, ADS1115, + IIS2MDCTR, + ISM330DHCX, } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 5a9ec9a65..b8b6915c2 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -584,6 +584,9 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) if (registerValue == 0x6A) { type = LSM6DS3; logFoundDevice("LSM6DS3", (uint8_t)addr.address); + } else if (registerValue == 0x6B) { + type = ISM330DHCX; + logFoundDevice("ISM330DHCX", (uint8_t)addr.address); } else { type = QMI8658; logFoundDevice("QMI8658", (uint8_t)addr.address); @@ -591,7 +594,17 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) break; SCAN_SIMPLE_CASE(QMC5883L_ADDR, QMC5883L, "QMC5883L", (uint8_t)addr.address) - SCAN_SIMPLE_CASE(HMC5883L_ADDR, HMC5883L, "HMC5883L", (uint8_t)addr.address) + case HMC5883L_ADDR: + registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x4FU), 1); // get ID + if (registerValue == 0x40) { + type = IIS2MDCTR; + logFoundDevice("IIS2MDCTR", (uint8_t)addr.address); + break; + } else { + type = HMC5883L; + logFoundDevice("HMC5883L", (uint8_t)addr.address); + break; + } #ifdef HAS_QMA6100P SCAN_SIMPLE_CASE(QMA6100P_ADDR, QMA6100P, "QMA6100P", (uint8_t)addr.address) #else diff --git a/variants/nrf52840/heltec_mesh_node_t1/variant.cpp b/variants/nrf52840/heltec_mesh_node_t1/variant.cpp index eb719f17f..1ea214069 100644 --- a/variants/nrf52840/heltec_mesh_node_t1/variant.cpp +++ b/variants/nrf52840/heltec_mesh_node_t1/variant.cpp @@ -25,8 +25,7 @@ const uint32_t g_ADigitalPinMap[] = { // P0 - pins 0 and 1 are hardwired for xtal and should never be enabled - 0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, + 0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, // P1 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};