summaryrefslogtreecommitdiffstats
path: root/libsensors/akm8975.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "i9300: rewrite libsensors in c++"Wolfgang Wiedmeyer2017-01-131-0/+612
| | | | This reverts commit 381a05756bdbe474ab76242a4e2934d81b8975e9.
* i9300: rewrite libsensors in c++Simon Shields2016-03-051-612/+0
| | | | | | | | * based off t0lte sensors * AkmSensor kanged from i9100 (added sensor status support) * has a working compass! Change-Id: Iaed0463c33089ca0b636be4ba3f966f2e25f34f9
* libsensors: switch to portable typedefs to match callbacksDheeraj CVR2015-11-251-4/+4
| | | | | | | | | | | | | 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
* i9300: libsensors: remove unused orientation sensorChristian Balster2015-11-251-13/+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-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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: add real accuracy reporting for magnetometerChristian Balster2015-11-251-5/+25
| | | | 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-251-56/+65
| | | | | | - Orientation sensor still broken Change-Id: I7d20afbbc1f8b1ca5d046a38c0c3b7ce824c12cd
* i9300: libsensors: fix compass orientationDaniel Hillenbrand2013-09-041-1/+1
| | | | Change-Id: I35255735cc895047d7594bdb595db052a8a086ac
* i9300: add opensource sensors halPaul Kocialkowski2013-09-021-0/+587
Change-Id: Ia104c31f165fcaca1ee5dc471f7d71ca9abd387f