From 71da859d0173c1651ff20bb0bef288cc29bf0711 Mon Sep 17 00:00:00 2001 From: Jason Maloney Date: Fri, 13 May 2011 20:25:26 -0500 Subject: [PATCH] Heroc: Report 0 instead of max lux on wrong read Borrowed from Bravo/Bravoc. Change-Id: Ic7471cd3e44657ed202ace1d5b8556505dafd8a5 --- libsensors/LightSensor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsensors/LightSensor.cpp b/libsensors/LightSensor.cpp index 6b212e8..5d24b3f 100644 --- a/libsensors/LightSensor.cpp +++ b/libsensors/LightSensor.cpp @@ -157,6 +157,6 @@ float LightSensor::indexToValue(size_t index) const const size_t maxIndex = sizeof(luxValues)/sizeof(*luxValues) - 1; if (index > maxIndex) - index = maxIndex; + index = 0; return luxValues[index]; }