if(!result) //返回0代表初始化成功
{
if(!mpu_set_sensors(INV_XYZ_GYRO | INV_XYZ_ACCEL)){}
if(!mpu_configure_fifo(INV_XYZ_GYRO | INV_XYZ_ACCEL)){}
if(!mpu_set_sample_rate(DEFAULT_MPU_HZ)){}
if(!dmp_load_motion_driver_firmware()){}
if(!dmp_set_orientation(inv_orientation_matrix_to_scalar(gyro_orientation))){}
if(!dmp_enable_feature(DMP_FEATURE_6X_LP_QUAT | DMP_FEATURE_TAP |
DMP_FEATURE_ANDROID_ORIENT | DMP_FEATURE_SEND_RAW_ACCEL | DMP_FEATURE_SEND_CAL_GYRO |
DMP_FEATURE_GYRO_CAL))
{}
if(!dmp_set_fifo_rate(DEFAULT_MPU_HZ)){}
if(!mpu_set_dmp_state(1)){}
}
1