summaryrefslogtreecommitdiffstats
path: root/libsensors
diff options
context:
space:
mode:
authorVishnudev Ramakrishnan <vramakri@sta.samsung.com>2011-07-01 16:19:17 -0700
committerMike Lockwood <lockwood@android.com>2011-07-19 17:41:14 -0700
commitf471c8feaaa4f2b3ce67b8f737853ad928d71700 (patch)
tree318155d405a61620688d16b5d0b203382b62568e /libsensors
parentfab7a0f31d11794fc19a42c24641fd54bf85c4c7 (diff)
downloaddevice_samsung_tuna-f471c8feaaa4f2b3ce67b8f737853ad928d71700.zip
device_samsung_tuna-f471c8feaaa4f2b3ce67b8f737853ad928d71700.tar.gz
device_samsung_tuna-f471c8feaaa4f2b3ce67b8f737853ad928d71700.tar.bz2
tuna: sensors: Light sensor ADC calibration values
Changed the light sensor ADC calibration values to the ones provided by proxima hardware team. Also corrected the comparison operator during adc to lux lookup to account for boundary values. Change-Id: I434f5bf8774f5eff0e639377db73c058a10f7d2d Signed-off-by: Vishnudev Ramakrishnan <vramakri@sta.samsung.com>
Diffstat (limited to 'libsensors')
-rw-r--r--libsensors/LightSensor.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/libsensors/LightSensor.cpp b/libsensors/LightSensor.cpp
index 067654f..8c111f9 100644
--- a/libsensors/LightSensor.cpp
+++ b/libsensors/LightSensor.cpp
@@ -49,18 +49,18 @@ float LightSensor::indexToValue(size_t index) const {
size_t adc_value;
float lux_value;
} adcToLux[] = {
- { 150, 10.0 }, /* from 0 - 150 adc, we map to 10.0 lux */
- { 800, 160.0 }, /* from 151 - 800 adc, we map to 160.0 lux */
- { 900, 225.0 }, /* from 801 - 900 adc, we map to 225.0 lux */
- { 1000, 320.0 }, /* from 901 - 1000 adc, we map to 320.0 lux */
- { 1200, 640.0 }, /* from 1001 - 1200 adc, we map to 640.0 lux */
- { 1400, 1280.0 }, /* from 1201 - 1400 adc, we map to 1280.0 lux */
- { 1600, 2600.0 }, /* from 1401 - 1600 adc, we map to 2600.0 lux */
- { 4095, 10240.0 }, /* from 1601 - 4095 adc, we map to 10240.0 lux */
+ { 50, 10.0 }, /* from 0 - 50 adc, we map to 10.0 lux */
+ { 280, 160.0 }, /* from 51 - 280 adc, we map to 160.0 lux */
+ { 320, 225.0 }, /* from 281 - 320 adc, we map to 225.0 lux */
+ { 350, 320.0 }, /* from 321 - 350 adc, we map to 320.0 lux */
+ { 400, 640.0 }, /* from 351 - 400 adc, we map to 640.0 lux */
+ { 520, 1280.0 }, /* from 401 - 520 adc, we map to 1280.0 lux */
+ { 590, 2600.0 }, /* from 521 - 590 adc, we map to 2600.0 lux */
+ { 1024, 10240.0 }, /* from 591 - 1024 adc, we map to 10240.0 lux */
};
size_t i;
for (i = 0; i < ARRAY_SIZE(adcToLux); i++) {
- if (index < adcToLux[i].adc_value) {
+ if (index <= adcToLux[i].adc_value) {
return adcToLux[i].lux_value;
}
}