diff options
Diffstat (limited to 'sensors/lsm330dlc_gyroscope.c')
-rw-r--r-- | sensors/lsm330dlc_gyroscope.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sensors/lsm330dlc_gyroscope.c b/sensors/lsm330dlc_gyroscope.c index da2d81d..ffc0037 100644 --- a/sensors/lsm330dlc_gyroscope.c +++ b/sensors/lsm330dlc_gyroscope.c @@ -21,6 +21,7 @@ #include <fcntl.h> #include <errno.h> #include <math.h> +#include <string.h> #include <sys/types.h> #include <linux/ioctl.h> #include <linux/input.h> @@ -67,7 +68,7 @@ int lsm330dlc_gyroscope_init(struct smdk4x12_sensors_handlers *handlers, goto error; } - snprintf(data->path_delay, PATH_MAX, "%s/gyro_poll_delay", path); + snprintf(data->path_delay, PATH_MAX, "%s/poll_delay", path); handlers->poll_fd = input_fd; handlers->data = (void *) data; @@ -151,19 +152,19 @@ int lsm330dlc_gyroscope_deactivate(struct smdk4x12_sensors_handlers *handlers) return 0; } -int lsm330dlc_gyroscope_set_delay(struct smdk4x12_sensors_handlers *handlers, long int delay) +int lsm330dlc_gyroscope_set_delay(struct smdk4x12_sensors_handlers *handlers, int64_t delay) { struct lsm330dlc_gyroscope_data *data; int rc; - ALOGD("%s(%p, %ld)", __func__, handlers, delay); + ALOGD("%s(%p, %" PRId64 ")", __func__, handlers, delay); if (handlers == NULL || handlers->data == NULL) return -EINVAL; data = (struct lsm330dlc_gyroscope_data *) handlers->data; - rc = sysfs_value_write(data->path_delay, (int) delay); + rc = sysfs_value_write(data->path_delay, delay); if (rc < 0) { ALOGE("%s: Unable to write sysfs value", __func__); return -1; @@ -205,6 +206,8 @@ int lsm330dlc_gyroscope_get_data(struct smdk4x12_sensors_handlers *handlers, event->gyro.y = data->gyro.y; event->gyro.z = data->gyro.z; + event->gyro.status = SENSOR_STATUS_ACCURACY_MEDIUM; + do { rc = read(input_fd, &input_event, sizeof(input_event)); if (rc < (int) sizeof(input_event)) |