Lines Matching refs:inv_obj
149 inv_obj.got_no_motion_bias = TRUE; in inv_update_bias()
154 inv_error_t MLAccelMotionDetection(struct inv_obj_t *inv_obj) in MLAccelMotionDetection() argument
182 gain = inv_obj->accel_lpf_gain * rate; in MLAccelMotionDetection()
187 inv_obj->accel_lpf[kk] = in MLAccelMotionDetection()
188 inv_q30_mult(((1L << 30) - gain), inv_obj->accel_lpf[kk]); in MLAccelMotionDetection()
189 inv_obj->accel_lpf[kk] += inv_q30_mult(gain, accel[kk]); in MLAccelMotionDetection()
190 temp = accel[0] - inv_obj->accel_lpf[0]; in MLAccelMotionDetection()
194 if (accelMag > inv_obj->no_motion_accel_threshold) { in MLAccelMotionDetection()
195 inv_obj->no_motion_accel_time = currentTime; in MLAccelMotionDetection()
201 } else if ((currentTime - inv_obj->no_motion_accel_time) > in MLAccelMotionDetection()
202 5 * inv_obj->motion_duration) { in MLAccelMotionDetection()
221 inv_error_t MLPollMotionStatus(struct inv_obj_t * inv_obj) in MLPollMotionStatus() argument
229 result = MLAccelMotionDetection(inv_obj); in MLPollMotionStatus()
234 if (((inv_obj->interrupt_sources & INV_INT_MOTION) == 0) && in MLPollMotionStatus()
235 ((currentTime - inv_obj->poll_no_motion) <= 1000)) in MLPollMotionStatus()
238 inv_obj->poll_no_motion = currentTime; in MLPollMotionStatus()
255 if (motionFlag == inv_obj->motion_duration) { in MLPollMotionStatus()
256 if (inv_obj->motion_state == INV_MOTION) { in MLPollMotionStatus()
282 if (inv_obj->motion_state == INV_NO_MOTION) { in MLPollMotionStatus()
293 (unsigned char)((inv_obj->motion_duration >> 8) & 0xff); in MLPollMotionStatus()
294 regs[1] = (unsigned char)(inv_obj->motion_duration & 0xff); in MLPollMotionStatus()
305 if (inv_obj->motion_state == INV_NO_MOTION) { in MLPollMotionStatus()
330 if (inv_obj->last_motion != motionFlag) { in MLPollMotionStatus()
340 inv_obj->gyro_orient[i]) + in MLPollMotionStatus()
342 inv_obj->gyro_orient[i + 3]) + in MLPollMotionStatus()
343 inv_q30_mult(biasTmp2[2], inv_obj->gyro_orient[i + 6]); in MLPollMotionStatus()
345 inv_obj->gyro_bias[0] = inv_q30_mult(biasTmp[0], 1501974482L); in MLPollMotionStatus()
346 inv_obj->gyro_bias[1] = inv_q30_mult(biasTmp[1], 1501974482L); in MLPollMotionStatus()
347 inv_obj->gyro_bias[2] = inv_q30_mult(biasTmp[2], 1501974482L); in MLPollMotionStatus()
354 inv_obj->last_motion = motionFlag; in MLPollMotionStatus()