MPU6050 library
Fork of eMPL_MPU6050 by
Diff: inv_mpu_dmp_motion_driver.c
- Revision:
- 2:6c7eb2f19ada
- Parent:
- 0:1b6dab73c06b
--- a/inv_mpu_dmp_motion_driver.c Thu Nov 05 01:38:50 2015 +0000 +++ b/inv_mpu_dmp_motion_driver.c Fri Nov 27 21:12:04 2015 +0000 @@ -1281,8 +1281,8 @@ sensors[0] = 0; /* Get a packet. */ - if (mpu_read_fifo_stream(dmp.packet_length, fifo_data, more)) - return -1; + int ret = mpu_read_fifo_stream(dmp.packet_length, fifo_data, more); + if(ret) return ret; /* Parse DMP packet. */ if (dmp.feature_mask & (DMP_FEATURE_LP_QUAT | DMP_FEATURE_6X_LP_QUAT)) { @@ -1318,7 +1318,7 @@ /* Quaternion is outside of the acceptable threshold. */ mpu_reset_fifo(); sensors[0] = 0; - return -1; + return -2; } sensors[0] |= INV_WXYZ_QUAT; #endif