diff options
author | sbrissen <sbrissen@hotmail.com> | 2013-11-13 09:01:02 -0500 |
---|---|---|
committer | sbrissen <sbrissen@hotmail.com> | 2013-11-13 09:12:59 -0500 |
commit | 7fb9174903c3415abc027c9d4de508946c3011e5 (patch) | |
tree | 05de01c6e9845aa212e8832ba75681bfb35f0b1f /libsensors | |
parent | 0dc75f6b11c6cb5cb40bfda497269ae2d4718446 (diff) | |
download | device_samsung_kona-common-7fb9174903c3415abc027c9d4de508946c3011e5.zip device_samsung_kona-common-7fb9174903c3415abc027c9d4de508946c3011e5.tar.gz device_samsung_kona-common-7fb9174903c3415abc027c9d4de508946c3011e5.tar.bz2 |
kona-common: 4.4 updates
Change-Id: I99fae341e0f1e827608f43a14c9648a9476721ed
Diffstat (limited to 'libsensors')
-rw-r--r-- | libsensors/LightSensor.cpp | 10 | ||||
-rw-r--r-- | libsensors/sensors.cpp | 8 |
2 files changed, 8 insertions, 10 deletions
diff --git a/libsensors/LightSensor.cpp b/libsensors/LightSensor.cpp index e931e2e..3159c9e 100644 --- a/libsensors/LightSensor.cpp +++ b/libsensors/LightSensor.cpp @@ -121,12 +121,10 @@ int LightSensor::readEvents(sensors_event_t* data, int count) while (count && mInputReader.readEvent(&event)) { int type = event->type; if (type == EV_REL) { - // Convert adc value to lux assuming: - // I = 10 * log(Ev) uA - // R = 47kOhm - // Max adc value 4095 = 3.3V - // 1/4 of light reaches sensor - mPendingEvent.light = event->value; + if(event->value < 0) + mPendingEvent.light = 0; + else + mPendingEvent.light = event->value; } else if (type == EV_SYN) { mPendingEvent.timestamp = timevalToNano(event->time); if (mEnabled) { diff --git a/libsensors/sensors.cpp b/libsensors/sensors.cpp index a0194ef..99bed29 100644 --- a/libsensors/sensors.cpp +++ b/libsensors/sensors.cpp @@ -73,19 +73,19 @@ static const struct sensor_t sSensorList[] = { { "LIS3DH Acceleration Sensor", "STMicroelectronics", 1, SENSORS_ACCELERATION_HANDLE, - SENSOR_TYPE_ACCELEROMETER, RANGE_A, RESOLUTION_A, 0.20f, 10000, { } }, + SENSOR_TYPE_ACCELEROMETER, RANGE_A, RESOLUTION_A, 0.20f, 10000, 0, 0, { } }, { "MS-3R (YAS532) Magnetic Sensor", "Yamaha Corporation", 1, SENSORS_MAGNETIC_FIELD_HANDLE, - SENSOR_TYPE_MAGNETIC_FIELD, 2000.0f, 0.06f, 6.8f, 10000, { } }, + SENSOR_TYPE_MAGNETIC_FIELD, 2000.0f, 0.06f, 6.8f, 10000, 0, 0, { } }, { "MS-x Orientation Sensor", "Yamaha Corporation", 1, SENSORS_ORIENTATION_HANDLE, - SENSOR_TYPE_ORIENTATION, 360.0f, CONVERT_O, 7.8f, 10000, { } }, + SENSOR_TYPE_ORIENTATION, 360.0f, CONVERT_O, 7.8f, 10000, 0, 0, { } }, { "AL3201 Light Sensor", "LITEON", 1, SENSORS_LIGHT_HANDLE, - SENSOR_TYPE_LIGHT, 10240.0f, 1.0f, 0.75f, 0, { } }, + SENSOR_TYPE_LIGHT, 10240.0f, 1.0f, 0.75f, 0, 0, 0, { } }, }; |