diff options
author | tim.sk.lee <tim.sk.lee@samsung.com> | 2010-10-08 14:51:21 -0700 |
---|---|---|
committer | Brian Swetland <swetland@google.com> | 2010-10-08 21:29:42 -0700 |
commit | b5487ce1d17429476475074ae1f50fb980df1522 (patch) | |
tree | afa499f54c81264b938622d1abcccc10591a7956 /libsensors | |
parent | 83bf3c1b8e39d11dcd75fbbd5826dede81ff0702 (diff) | |
download | device_samsung_crespo-b5487ce1d17429476475074ae1f50fb980df1522.tar.gz device_samsung_crespo-b5487ce1d17429476475074ae1f50fb980df1522.tar.bz2 device_samsung_crespo-b5487ce1d17429476475074ae1f50fb980df1522.zip |
S5PC11X: SENSOR: Let gyroscope fetch full events before return correctly
Instead of removing 'FETCH_FULL_EVENT_BEFORE_RETURN' code,
make it check out whether gyrscope is enabled or disabled
and it will not go to 'again' label ceaselessly when gyroscope disabled
in order to not affect the other senors.
Change-Id: I11a09208a997d476724c70cbc4402ba6a163d8de
Signed-off-by: tim.sk.lee <tim.sk.lee@samsung.com>
Diffstat (limited to 'libsensors')
-rw-r--r-- | libsensors/GyroSensor.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libsensors/GyroSensor.cpp b/libsensors/GyroSensor.cpp index a12125c..c478e40 100644 --- a/libsensors/GyroSensor.cpp +++ b/libsensors/GyroSensor.cpp @@ -143,7 +143,6 @@ again: #endif while (count && mInputReader.readEvent(&event)) { int type = event->type; - // LOGE("GyroSensor::readEvents() event type = %d, code = %d, value = %d", event->type, event->code, event->value); if (type == EV_ABS) { float value = event->value; if (event->code == EVENT_TYPE_GYRO_X) { @@ -170,15 +169,13 @@ again: #if FETCH_FULL_EVENT_BEFORE_RETURN /* if we didn't read a complete event, see if we can fill and try again instead of returning with nothing and redoing poll. */ - if (numEventReceived == 0) { + if (numEventReceived == 0 && mEnabled == 1) { n = mInputReader.fill(data_fd); if (n) goto again; } #endif - LOGI("GyroSensor::readEvents() returning count %d", numEventReceived); - return numEventReceived; } |