result = 0;
if (!gyro_result)
result |= 0x01;
if (!accel_result)
result |= 0x02;
自检函数外部
result = mpu_run_self_test(gyro, accel);
if (result == 0x2)//3 0
{
/* Test passed. We can trust the gyro data here, so let's push it down
* to the DMP.
*/
float sens;
unsigned short accel_sens;
mpu_get_gyro_sens(&sens);
gyro[0] = (long)(gyro[0] * sens);
gyro[1] = (long)(gyro[1] * sens);
gyro[2] = (long)(gyro[2] * sens);
dmp_set_gyro_bias(gyro);
mpu_get_accel_sens(&accel_sens);