aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libsensors/Android.mk2
-rw-r--r--libsensors/piranha_sensors.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/libsensors/Android.mk b/libsensors/Android.mk
index 39cc493..f916e27 100644
--- a/libsensors/Android.mk
+++ b/libsensors/Android.mk
@@ -45,7 +45,7 @@ ifeq ($(TARGET_DEVICE),p5110)
LOCAL_CFLAGS += -DTARGET_DEVICE_P5100
endif
ifeq ($(TARGET_DEVICE),p3100)
- LOCAL_CFLAGS += -DTARGET_DEVICE_P3100
+ LOCAL_CFLAGS += -DTARGET_DEVICE_P3100 -DTARGET_HAS_PROXIMITY_SENSOR
endif
ifeq ($(TARGET_DEVICE),p3110)
LOCAL_CFLAGS += -DTARGET_DEVICE_P3100
diff --git a/libsensors/piranha_sensors.c b/libsensors/piranha_sensors.c
index 7474b33..4ab6943 100644
--- a/libsensors/piranha_sensors.c
+++ b/libsensors/piranha_sensors.c
@@ -53,6 +53,8 @@ struct sensor_t piranha_sensors[] = {
{ "GP2A Light Sensor", "Sharp", 1, SENSOR_TYPE_LIGHT,
SENSOR_TYPE_LIGHT, 0.0f, 0.0f, 0.0f, 0,
0, 0, 0, 0, 0, SENSOR_FLAG_CONTINUOUS_MODE, {0}, },
+#endif
+#ifdef TARGET_HAS_PROXIMITY_SENSOR
{ "GP2A Proximity Sensor", "Sharp", 1, SENSOR_TYPE_PROXIMITY,
SENSOR_TYPE_PROXIMITY, 5.0f, 0.0f, 0.0f, 0,
0, 0, 0, 0, 0, SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_ON_CHANGE_MODE, {0}, },
@@ -70,6 +72,8 @@ struct piranha_sensors_handlers *piranha_sensors_handlers[] = {
#endif
#ifdef TARGET_DEVICE_P3100
&gp2a_light,
+#endif
+#ifdef TARGET_HAS_PROXIMITY_SENSOR
&gp2a_proximity,
#endif
};