ICM426xx - Avoid long startup delays when target allows 42605 and

42688P.

If the target has a 42688P sensor there is a 20*150ms (3 second) delay
caused by the 42605 driver's detect code.

The 42605/42688P sensors are pin-compatible so it makes sense that a
target would specify BOTH sensors to allow flexibility in manufacturing.
This commit is contained in:
Dominic Clifton 2021-07-13 14:01:23 +02:00
parent 46c62cfcf2
commit 5f4a50de05
2 changed files with 6 additions and 0 deletions

View File

@ -126,6 +126,9 @@ uint8_t icm42605SpiDetect(const extDevice_t *dev)
case ICM42605_WHO_AM_I_CONST:
icmDetected = ICM_42605_SPI;
break;
case ICM42688P_WHO_AM_I_CONST:
icmDetected = ICM_42688P_SPI;
break;
default:
icmDetected = MPU_NONE;
break;

View File

@ -123,6 +123,9 @@ uint8_t icm42688PSpiDetect(const extDevice_t *dev)
delay(150);
const uint8_t whoAmI = spiReadRegMsk(dev, MPU_RA_WHO_AM_I);
switch (whoAmI) {
case ICM42605_WHO_AM_I_CONST:
icmDetected = ICM_42605_SPI;
break;
case ICM42688P_WHO_AM_I_CONST:
icmDetected = ICM_42688P_SPI;
break;