mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
fix(drivers/icm45686): retry WHO_AM_I on probe instead of requiring three matches (#28319)
The loop advertised three attempts but returned on the first mismatch, so a single garbage SPI read after power-up failed the probe. Match the ICM42688P retry: succeed on the first good ID, fail after three.
Assisted-by: Grok:grok-4.6
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
(cherry picked from commit a0071377f1)
This commit is contained in:
1 parent
8303efda43
commit
216b59329f
1 file changed
+5
-4
@@ -135,13 +135,14 @@ int ICM45686::probe()
|
||||
for (int i = 0; i < 3; i++) {
|
||||
const uint8_t whoami = RegisterRead(Register::BANK_0::WHO_AM_I);
|
||||
|
||||
if (whoami != WHOAMI) {
|
||||
DEVICE_DEBUG("unexpected WHO_AM_I 0x%02x", whoami);
|
||||
return PX4_ERROR;
|
||||
if (whoami == WHOAMI) {
|
||||
return PX4_OK;
|
||||
}
|
||||
|
||||
DEVICE_DEBUG("unexpected WHO_AM_I 0x%02x", whoami);
|
||||
}
|
||||
|
||||
return PX4_OK;
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
void ICM45686::RunImpl()
|
||||
|
||||
Reference in new issue
Block a user