diff options
author | Kyle Repinski <repinski23@gmail.com> | 2015-12-08 03:42:06 -0600 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-01-17 22:41:00 +0100 |
commit | 279fa1241dec2d666d92eec566a6cabfc1ad9f86 (patch) | |
tree | e8160418ed6b283386074a816d969916f497ba21 /libsensors/mlsdk/mllite/mlBiasNoMotion.c | |
parent | 3f2cb86a83bd0bc394399b7cd52f3db5339dc2d9 (diff) | |
download | device_samsung_tuna-279fa1241dec2d666d92eec566a6cabfc1ad9f86.tar.gz device_samsung_tuna-279fa1241dec2d666d92eec566a6cabfc1ad9f86.tar.bz2 device_samsung_tuna-279fa1241dec2d666d92eec566a6cabfc1ad9f86.zip |
libsensors: mlsdk: Remove lots of unused cruft.
This alone was enough to cut 16KB off of the mllite.so size.
Diffstat (limited to 'libsensors/mlsdk/mllite/mlBiasNoMotion.c')
-rw-r--r-- | libsensors/mlsdk/mllite/mlBiasNoMotion.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libsensors/mlsdk/mllite/mlBiasNoMotion.c b/libsensors/mlsdk/mllite/mlBiasNoMotion.c index aaf98d2..2cec85c 100644 --- a/libsensors/mlsdk/mllite/mlBiasNoMotion.c +++ b/libsensors/mlsdk/mllite/mlBiasNoMotion.c @@ -71,7 +71,7 @@ inv_error_t inv_set_motion_callback(void (*func) (unsigned short motion_state)) return INV_SUCCESS; } -inv_error_t inv_update_bias(void) +static inv_error_t inv_update_bias(void) { INVENSENSE_FUNC_START; inv_error_t result; @@ -127,7 +127,7 @@ inv_error_t inv_update_bias(void) return INV_SUCCESS; } -inv_error_t MLAccelMotionDetection(struct inv_obj_t *inv_obj) +static inv_error_t MLAccelMotionDetection(struct inv_obj_t *inv_obj) { long gain; unsigned long timeChange; @@ -171,14 +171,18 @@ inv_error_t MLAccelMotionDetection(struct inv_obj_t *inv_obj) inv_obj->no_motion_accel_time = currentTime; // Check for change of state - if (!inv_get_gyro_present()) + + // TODO: With !gyro check in place, motion callbacks are NEVER fired? + //if (!inv_get_gyro_present()) inv_set_motion_state(INV_MOTION); } else if ((currentTime - inv_obj->no_motion_accel_time) > 5 * inv_obj->motion_duration) { // We have no motion according to accel - // Check fsor change of state - if (!inv_get_gyro_present()) + // Check for change of state + + // TODO: With !gyro check in place, motion callbacks are NEVER fired? + //if (!inv_get_gyro_present()) inv_set_motion_state(INV_NO_MOTION); } } @@ -194,7 +198,7 @@ inv_error_t MLAccelMotionDetection(struct inv_obj_t *inv_obj) * 'no motion' state and update the internal motion status and bias * calculations. */ -inv_error_t MLPollMotionStatus(struct inv_obj_t * inv_obj) +static inv_error_t MLPollMotionStatus(struct inv_obj_t * inv_obj) { INVENSENSE_FUNC_START; unsigned char regs[3] = { 0 }; @@ -225,9 +229,8 @@ inv_error_t MLPollMotionStatus(struct inv_obj_t * inv_obj) motionFlag = (unsigned short)regs[0] * 256 + (unsigned short)regs[1]; - _mlDebug(MPL_LOGV("motionFlag from RAM : 0x%04X\n", motionFlag); - ) - if (motionFlag == inv_obj->motion_duration) { + _mlDebug(MPL_LOGV("motionFlag from RAM : 0x%04X\n", motionFlag);) + if (motionFlag == inv_obj->motion_duration) { if (inv_obj->motion_state == INV_MOTION) { inv_update_bias(); repeatBiasUpdateTime = inv_get_tick_count(); |