MPU6050 library
Fork of eMPL_MPU6050 by
Diff: inv_mpu.c
- Revision:
- 2:6c7eb2f19ada
- Parent:
- 0:1b6dab73c06b
- Child:
- 3:b931c48531b4
diff -r 6aedb937cb38 -r 6c7eb2f19ada inv_mpu.c --- a/inv_mpu.c Thu Nov 05 01:38:50 2015 +0000 +++ b/inv_mpu.c Fri Nov 27 21:12:04 2015 +0000 @@ -1850,29 +1850,29 @@ unsigned char tmp[2]; unsigned short fifo_count; if (!st.chip_cfg.dmp_on) - return -1; + return -10; if (!st.chip_cfg.sensors) - return -1; + return -11; if (i2c_read(st.hw->addr, st.reg->fifo_count_h, 2, tmp)) - return -1; + return -12; fifo_count = (tmp[0] << 8) | tmp[1]; if (fifo_count < length) { more[0] = 0; - return -1; + return -13000+length; } if (fifo_count > (st.hw->max_fifo >> 1)) { /* FIFO is 50% full, better check overflow bit. */ if (i2c_read(st.hw->addr, st.reg->int_status, 1, tmp)) - return -1; + return -14; if (tmp[0] & BIT_FIFO_OVERFLOW) { mpu_reset_fifo(); - return -2; + return -15; } } if (i2c_read(st.hw->addr, st.reg->fifo_r_w, length, data)) - return -1; + return -16; more[0] = fifo_count / length - 1; return 0; }