mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 18:35:28 +00:00
device: si114x: Address overflow condition
If proximity overflow (daylight), we would still assume the data was valid and consider there is an object very very close. That would prevent the light to be measured. (cl/312982) Leave the value as max range for the HAL to handle. BRANCH=smaug BUG=b:25573958 TEST=Check in daylight that light is still measured Change-Id: I684e6f4a9aecd3fd6b338a9939f7ede26752ecb8 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/314921 Reviewed-by: Alec Berg <alecaberg@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
7f6862e5e0
commit
02ddede08e
@@ -96,7 +96,7 @@ static int si114x_read_results(struct motion_sensor_t *s, int nb)
|
||||
/* Add offset, calibration */
|
||||
if (val + type_data->offset <= 0) {
|
||||
val = 1;
|
||||
} else {
|
||||
} else if (val != SI114X_OVERFLOW) {
|
||||
val += type_data->offset;
|
||||
/*
|
||||
* Proxmitiy sensor data is inverse of the distance.
|
||||
|
||||
@@ -206,6 +206,7 @@
|
||||
|
||||
/* Proximity sensor finds an object within 5 cm, disable light sensor */
|
||||
#define SI114X_COVERED_THRESHOLD 5
|
||||
#define SI114X_OVERFLOW 0xffff
|
||||
|
||||
extern const struct accelgyro_drv si114x_drv;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user