From ab00b6dab6480056d7bc4804262cc3016e78c5ed Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sun, 28 Jul 2024 15:28:54 +1000 Subject: [PATCH] Also mask the probe --- source/Core/Drivers/LIS2DH12.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/Core/Drivers/LIS2DH12.cpp b/source/Core/Drivers/LIS2DH12.cpp index c8ee8409..24ac5f58 100644 --- a/source/Core/Drivers/LIS2DH12.cpp +++ b/source/Core/Drivers/LIS2DH12.cpp @@ -45,7 +45,11 @@ bool LIS2DH12::detect() { // Read chip id to ensure its not an address collision uint8_t id = 0; if (ACCEL_I2C_CLASS::Mem_Read(LIS2DH_I2C_ADDRESS, LIS2DH_WHOAMI_REG, &id, 1)) { +#ifdef ACCEL_LIS_CLONE return (id == LIS2DH_WHOAMI_ID) || (id == LIS2DH_CLONE_WHOAMI_ID); +#else + return (id == LIS2DH_WHOAMI_ID); +#endif } return false; // cant read ID }