Skip to content

Commit

Permalink
Also mask the probe
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralim committed Jul 28, 2024
1 parent 57ce9a5 commit c04c88f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/Core/Drivers/LIS2DH12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
{ LIS_CTRL_REG4, 0b00001000, 0}, // Block update mode off, HR on
{ LIS_CTRL_REG5, 0b00000010, 0}, //
{ LIS_CTRL_REG6, 0b01100010, 0},
// Basically setup the unit to run, and enable 4D orientation detection
// Basically setup the unit to run, and enable 4D orientation detection
{ LIS_INT2_CFG, 0b01111110, 0}, // setup for movement detection
{ LIS_INT2_THS, 0x28, 0}, //
{LIS_INT2_DURATION, 64, 0}, //
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit c04c88f

Please sign in to comment.