summaryrefslogtreecommitdiffstats
path: root/libsensors
Commit message (Collapse)AuthorAgeFilesLines
* i9300: libsensors: fix possible overflow while setting delayChristian Balster2015-12-182-7/+7
| | | | | | | | Even though we changed the signature of the set_delay() methods, we can still get an overflow while actually writing the values to sysfs. Let's adapt sysfs_value_read() and sysfs_value_write() too. Change-Id: If8eda7204831f0edabec890d4e3127be520fa3bf
* libsensors: switch to portable typedefs to match callbacksDheeraj CVR2015-11-259-29/+30
| | | | | | | | | | | | | Using a strict basetype only coding style is not a good idea especially when we are dealing with callbacks which use portable typedef like int64_t. This kind of coding style would most likely end up in overflows at various places especially when dealing with timestamps and sensor delays which are caused when typecasting datatypes of different size. Switch to portable typedefs and get rid of "long". Change-Id: I75b9cace7602345dba9095f046292e6d4db07df4
* libsensors: fix light sensorJavi Ferrer2015-11-251-3/+37
| | | | Change-Id: I7cad5c048c1a9877889216ca8ca43bb13daeb4b0
* i9300: libsensors: remove unused orientation sensorChristian Balster2015-11-256-480/+0
| | | | | | | | | | | | | The Orientation Sensor is deprecated and no longer required. Additionally this implementation is never even used, since Android automatically replaces it by it's own implementation if the sensor HAL doesn't also provide a Rotation Vector sensor. Furthermore the current implementation only uses the accelerometer and magnetometer for the sensor fusion and doesn't make use of the Gyroscope. So should we at some point decide to implement our own complete sensor fusion this would have to be rewritten anyway. Change-Id: I45d8a9afd2089b49131e6cc69cdf2f3dfee46c92
* i9300: libsensors: Fix compass orientation (for real)Christian Balster2015-11-254-6/+6
| | | | | | | | | | | | | | | | | | | | | | | Actually this fixes several more problems, but the compass orientation is the most noticeable symptom of this: Android expects sensor event timestamps in nanoseconds. Linux timestamps on the other hand are saved in the timeval struct in seconds and micro- seconds. Therefore these need to be converted, which is easy enough and is implemented in input.c of libsensors. Unfortunately, the current implementation uses type long int for the return value and all further calculations. Since the nanosecond values easily exceed 2^32 the buffers overflow and wrap, which results in the reported timestamps moving between -2^16 and 2^16. The consequences of this are noticeable especially with fused sensors integrating the gyroscope readings, which use the difference of two timestamps to calculate the change in orientation by multiplying it by the rotation rate. When the buffer wraps around this results in a huge time difference and thus leads to a momentary orientation change every ~4.3 seconds. This commit fixes this behavior by using long long int. Change-Id: Ib47bdc36ece16371c82f61b125315074ec048e32
* i9300: libsensors: fix magnetometer offset parameters not being savedChristian Balster2015-11-251-10/+19
| | | | | | also fix a typo Change-Id: I69246a96c53d7ec02ca90d73bc85dec4cbc73343
* i9300: libsensors: report at least bogus accuracy for gyroChristian Balster2015-11-251-0/+2
| | | | Change-Id: I81ff71c8ae6bf25c1aabac4a6d8d6fcf64bd2e0b
* i9300: libsensors: fix typo in accelerometer dataChristian Balster2015-11-251-1/+1
| | | | Change-Id: Iee501b65c23bed22bfe769496bafc852f939a8ac
* i9300: libsensors: add real accuracy reporting for magnetometerChristian Balster2015-11-252-5/+26
| | | | Change-Id: I3dd56f4d7fb0de8feca2422c165fe0c3cd92761a
* Revert "i9300: libsensors: fix compass orientation"Christian Balster2015-11-251-1/+1
| | | | | | | | | This reverts commit 9f7182d0542f4c82b6fe4722b8b9389021ad6ae9. Let's not mess with the magnetometer sensitivity adjustments. The magnetometer orientations are correct as is. Change-Id: I218578088c43a27f4ff89d8c9e1671641725817a
* i9300: update libsensors from replicantJavi Ferrer2015-11-2516-631/+652
| | | | | | - Orientation sensor still broken Change-Id: I7d20afbbc1f8b1ca5d046a38c0c3b7ce824c12cd
* i9300: libsensors: L bringup - fix buildDheeraj CVR2015-11-251-7/+14
| | | | Change-Id: I3c5cd29a497d2a84da7742b8fdf54bf4e0869cee
* Updates for 11.0Ricardo Cerqueira2013-11-061-7/+7
| | | | Change-Id: I5adfaacbfd6eff42e4e861fcd67281421e230f86
* i9300: libsensors: fix compass orientationDaniel Hillenbrand2013-09-041-1/+1
| | | | Change-Id: I35255735cc895047d7594bdb595db052a8a086ac
* i9300: add opensource sensors halPaul Kocialkowski2013-09-0242-0/+7014
Change-Id: Ia104c31f165fcaca1ee5dc471f7d71ca9abd387f