Resolve the bug of mpu6050 initialization failure (#115)

* Resolve the bug of mpu6050 initialization failure

* Update components/core/crazyflie/hal/src/sensors_mpu6050_hm5883L_ms5611.c
This commit is contained in:
zhongchaoesp
2025-07-24 21:59:16 +08:00
committed by GitHub
parent cbe4e806ee
commit 527ee2e09c
2 changed files with 6 additions and 2 deletions
@@ -415,8 +415,11 @@ static void sensorsDeviceInit(void)
DEBUG_PRINTI("MPU6050 I2C connection [OK].\n");
} else {
DEBUG_PRINTE("MPU6050 I2C connection [FAIL].\n");
// Please check your hardware !
assert(0);
DEBUG_PRINTE("Please power off and power on the device.\n");
while (1)
{
vTaskDelay(M2T(100));
}
}
mpu6050Reset();
@@ -77,6 +77,7 @@ bool mpu6050Test(void)
*/
bool mpu6050TestConnection()
{
vTaskDelay(M2T(100));
return mpu6050GetDeviceID() == 0b110100;
}