diff options
Diffstat (limited to 'sensors/smdk4210_sensors.c')
-rw-r--r-- | sensors/smdk4210_sensors.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/sensors/smdk4210_sensors.c b/sensors/smdk4210_sensors.c index 6e1b92f..113d215 100644 --- a/sensors/smdk4210_sensors.c +++ b/sensors/smdk4210_sensors.c @@ -36,19 +36,22 @@ struct sensor_t smdk4210_sensors[] = { { "K3DH Acceleration Sensor", "STMicroelectronics", 1, SENSOR_TYPE_ACCELEROMETER, - SENSOR_TYPE_ACCELEROMETER, 2 * GRAVITY_EARTH, GRAVITY_EARTH / 90.0f / 8.0f, 0.23f, 20000, {}, }, - { "AKM8975 Magnetic Sensor", "Asahi Kasei Microdevices", 1, SENSOR_TYPE_MAGNETIC_FIELD, - SENSOR_TYPE_MAGNETIC_FIELD, 2000.0f, 1.0f / 16, 6.8f, 16667, {}, }, - { "Orientation Sensor", "SMDK4210 Sensors", 1, SENSOR_TYPE_ORIENTATION, - SENSOR_TYPE_ORIENTATION, 360.0f, 0.1f, 0.0f, 16667, {}, }, + SENSOR_TYPE_ACCELEROMETER, 2 * GRAVITY_EARTH, GRAVITY_EARTH / 90.0f / 8.0f, 0.23f, 20000, 0, 0, }, + { "AKM8975C 3-Axis Magnetic Sensor", "Asahi Kasei", 1, SENSOR_TYPE_MAGNETIC_FIELD, + SENSOR_TYPE_MAGNETIC_FIELD, 2000.0f, 1.0f / 16, 6.8f, 16667, 0, 0, SENSOR_STRING_TYPE_MAGNETIC_FIELD, 0, 0, + SENSOR_FLAG_CONTINUOUS_MODE, {}, }, { "GP2A Light Sensor", "Sharp", 1, SENSOR_TYPE_LIGHT, - SENSOR_TYPE_LIGHT, 10240.0f, 1.0f, 0.75f, 0, {}, }, + SENSOR_TYPE_LIGHT, 10240.0f, 1.0f, 0.75f, 0, 0, 0, SENSOR_STRING_TYPE_LIGHT, 0, 0, + SENSOR_FLAG_ON_CHANGE_MODE, {}, }, { "GP2A Proximity Sensor", "Sharp", 1, SENSOR_TYPE_PROXIMITY, - SENSOR_TYPE_PROXIMITY, 5.0f, 5.0f, 0.75f, 0, {}, }, + SENSOR_TYPE_PROXIMITY, 5.0f, 5.0f, 0.75f, 0, 0, 0, SENSOR_STRING_TYPE_PROXIMITY, 0, 0, + SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_ON_CHANGE_MODE, {}, }, { "K3G Gyroscope Sensor", "STMicroelectronics", 1, SENSOR_TYPE_GYROSCOPE, - SENSOR_TYPE_GYROSCOPE, 500.0f * (3.1415926535f / 180.0f), (70.0f / 4000.0f) * (3.1415926535f / 180.0f), 6.1f, 1190, {}, }, + SENSOR_TYPE_GYROSCOPE, 500.0f * (3.1415926535f / 180.0f), (70.0f / 4000.0f) * (3.1415926535f / 180.0f), 6.1f, 1190, 0, 0, SENSOR_STRING_TYPE_GYROSCOPE, 0, 0, + SENSOR_FLAG_CONTINUOUS_MODE, {}, }, { "BMP180 Pressure Sensor", "Bosch", 1, SENSOR_TYPE_PRESSURE, - SENSOR_TYPE_PRESSURE, 1100.0f, 0.01f, 0.67f, 20000, {}, }, + SENSOR_TYPE_PRESSURE, 1100.0f, 0.01f, 0.67f, 20000, 0, 0, SENSOR_STRING_TYPE_PRESSURE, 0, 20000, + SENSOR_FLAG_CONTINUOUS_MODE, {}, }, }; int smdk4210_sensors_count = sizeof(smdk4210_sensors) / sizeof(struct sensor_t); @@ -56,7 +59,6 @@ int smdk4210_sensors_count = sizeof(smdk4210_sensors) / sizeof(struct sensor_t); struct smdk4210_sensors_handlers *smdk4210_sensors_handlers[] = { &k3dh, &akm8975, - &orientation, &gp2a_light, &gp2a_proximity, &k3g, @@ -116,7 +118,7 @@ int smdk4210_sensors_set_delay(struct sensors_poll_device_t *dev, int handle, struct smdk4210_sensors_device *device; int i; - ALOGD("%s(%p, %d, %ld)", __func__, dev, handle, (long int) ns); + ALOGD("%s(%p, %d, %" PRId64 ")", __func__, dev, handle, ns); if (dev == NULL) return -EINVAL; @@ -131,7 +133,7 @@ int smdk4210_sensors_set_delay(struct sensors_poll_device_t *dev, int handle, continue; if (device->handlers[i]->handle == handle && device->handlers[i]->set_delay != NULL) - return device->handlers[i]->set_delay(device->handlers[i], (long int) ns); + return device->handlers[i]->set_delay(device->handlers[i], ns); } return 0; |