summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Repinski <repinski23@gmail.com>2015-11-09 12:54:48 -0600
committerZiyan <jaraidaniel@gmail.com>2016-01-17 22:40:59 +0100
commit9fe751cd9c53c83ff8cb3cc076d4a573fe855043 (patch)
treeba4195b33775645e76510b01f103f336202d0b4c
parent7ae898b6793c747b2611f328af32cc1f69b124e8 (diff)
downloaddevice_samsung_tuna-9fe751cd9c53c83ff8cb3cc076d4a573fe855043.zip
device_samsung_tuna-9fe751cd9c53c83ff8cb3cc076d4a573fe855043.tar.gz
device_samsung_tuna-9fe751cd9c53c83ff8cb3cc076d4a573fe855043.tar.bz2
invensense: Cleanup and update sensor struct.
-rw-r--r--invensense/libinvensense_hal/MPLSensor.cpp45
1 files changed, 23 insertions, 22 deletions
diff --git a/invensense/libinvensense_hal/MPLSensor.cpp b/invensense/libinvensense_hal/MPLSensor.cpp
index 9ad911f..aa6c76a 100644
--- a/invensense/libinvensense_hal/MPLSensor.cpp
+++ b/invensense/libinvensense_hal/MPLSensor.cpp
@@ -71,27 +71,28 @@ extern "C" {
/* Base values for the sensor list, these need to be in the order defined in MPLSensor.h */
static struct sensor_t sSensorList[] =
- { { "MPL Gyroscope", "Invensense", 1,
- SENSORS_GYROSCOPE_HANDLE,
- SENSOR_TYPE_GYROSCOPE, 2000.0f, 1.0f, 0.5f, 10000, 0, 0, 0, 0, 0, 0, { } },
- { "MPL Accelerometer", "Invensense", 1,
- SENSORS_ACCELERATION_HANDLE,
- SENSOR_TYPE_ACCELEROMETER, 10240.0f, 1.0f, 0.5f, 10000, 0, 0, 0, 0, 0, 0, { } },
- { "MPL Magnetic Field", "Invensense", 1,
- SENSORS_MAGNETIC_FIELD_HANDLE,
- SENSOR_TYPE_MAGNETIC_FIELD, 10240.0f, 1.0f, 0.5f, 10000, 0, 0, 0, 0, 0, 0, { } },
- { "MPL Orientation", "Invensense", 1,
- SENSORS_ORIENTATION_HANDLE,
- SENSOR_TYPE_ORIENTATION, 360.0f, 1.0f, 9.7f, 10000, 0, 0, 0, 0, 0, 0, { } },
- { "MPL Rotation Vector", "Invensense", 1,
- SENSORS_ROTATION_VECTOR_HANDLE,
- SENSOR_TYPE_ROTATION_VECTOR, 10240.0f, 1.0f, 0.5f, 10000, 0, 0, 0, 0, 0, 0, { } },
- { "MPL Linear Acceleration", "Invensense", 1,
- SENSORS_LINEAR_ACCEL_HANDLE,
- SENSOR_TYPE_LINEAR_ACCELERATION, 10240.0f, 1.0f, 0.5f, 10000, 0, 0, 0, 0, 0, 0, { } },
- { "MPL Gravity", "Invensense", 1,
- SENSORS_GRAVITY_HANDLE,
- SENSOR_TYPE_GRAVITY, 10240.0f, 1.0f, 0.5f, 10000, 0, 0, 0, 0, 0, 0, { } },
+{
+ {"MPL Gyroscope", "Invensense", 1, SENSORS_GYROSCOPE_HANDLE,
+ SENSOR_TYPE_GYROSCOPE, 2000.0f, 1.0f, 0.5f, 10000, 0, 0,
+ SENSOR_STRING_TYPE_GYROSCOPE, "", 0, SENSOR_FLAG_CONTINUOUS_MODE, {}},
+ {"MPL Accelerometer", "Invensense", 1, SENSORS_ACCELERATION_HANDLE,
+ SENSOR_TYPE_ACCELEROMETER, 10240.0f, 1.0f, 0.5f, 10000, 0, 0,
+ SENSOR_STRING_TYPE_ACCELEROMETER, "", 0, SENSOR_FLAG_CONTINUOUS_MODE, {}},
+ {"MPL Magnetic Field", "Invensense", 1, SENSORS_MAGNETIC_FIELD_HANDLE,
+ SENSOR_TYPE_MAGNETIC_FIELD, 10240.0f, 1.0f, 0.5f, 10000, 0, 0,
+ SENSOR_STRING_TYPE_MAGNETIC_FIELD, "", 0, SENSOR_FLAG_CONTINUOUS_MODE, {}},
+ {"MPL Orientation", "Invensense", 1, SENSORS_ORIENTATION_HANDLE,
+ SENSOR_TYPE_ORIENTATION, 360.0f, 1.0f, 9.7f, 10000, 0, 0,
+ SENSOR_STRING_TYPE_ORIENTATION, "", 0, SENSOR_FLAG_CONTINUOUS_MODE, {}},
+ {"MPL Rotation Vector", "Invensense", 1, SENSORS_ROTATION_VECTOR_HANDLE,
+ SENSOR_TYPE_ROTATION_VECTOR, 10240.0f, 1.0f, 0.5f, 10000, 0, 0,
+ SENSOR_STRING_TYPE_ORIENTATION, "", 0, SENSOR_FLAG_CONTINUOUS_MODE, {}},
+ {"MPL Linear Acceleration", "Invensense", 1, SENSORS_LINEAR_ACCEL_HANDLE,
+ SENSOR_TYPE_LINEAR_ACCELERATION, 10240.0f, 1.0f, 0.5f, 10000, 0, 0,
+ SENSOR_STRING_TYPE_LINEAR_ACCELERATION, "", 0, SENSOR_FLAG_CONTINUOUS_MODE, {}},
+ {"MPL Gravity", "Invensense", 1, SENSORS_GRAVITY_HANDLE,
+ SENSOR_TYPE_GRAVITY, 10240.0f, 1.0f, 0.5f, 10000, 0, 0,
+ SENSOR_STRING_TYPE_GRAVITY, "", 0, SENSOR_FLAG_CONTINUOUS_MODE, {}},
};
static unsigned long long irq_timestamp = 0;
@@ -960,7 +961,7 @@ int MPLSensor::readEvents(sensors_event_t* data, int count)
if (mEnabled & (1 << i)) {
CALL_MEMBER_FN(this,mHandlers[i])(mPendingEvents + i,
&mPendingMask, i);
- mPendingEvents[i].timestamp = irq_timestamp;
+ mPendingEvents[i].timestamp = irq_timestamp;
}
}