diff options
author | Nick Vaccaro <nvaccaro@google.com> | 2014-04-28 17:44:27 -0700 |
---|---|---|
committer | Nick Vaccaro <nvaccaro@google.com> | 2014-04-29 11:54:10 -0700 |
commit | b15903ff47c3d5234f14919941b36bf26a96a82e (patch) | |
tree | 69761eb1800abc6e5db9e04531aafecc6dadbfca /6515/libsensors_iio/sensors.h | |
parent | dc17e951c1ea1633fb80a9a59931e073f154c924 (diff) | |
download | invensense-b15903ff47c3d5234f14919941b36bf26a96a82e.tar.gz |
Invensense: 6515: fix bug caused when pressure sensor is disabled
If building the Invensense HAL to not include a pressure sensor, the
sensorlist returned from the HAL gets screwed up in that the sensor
attributes reported by the HAL get off-by-one (i.e. sensor #2 reports
attributes for sensor #3).
Bug: 14368807
Change-Id: I9c1e634dc0f471dbb8eedf8d36bc8e2fdaf2ce67
Diffstat (limited to '6515/libsensors_iio/sensors.h')
-rwxr-xr-x | 6515/libsensors_iio/sensors.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/6515/libsensors_iio/sensors.h b/6515/libsensors_iio/sensors.h index b7f5192..17774ff 100755 --- a/6515/libsensors_iio/sensors.h +++ b/6515/libsensors_iio/sensors.h @@ -62,7 +62,9 @@ enum { Accelerometer, MagneticField, RawMagneticField, +#ifdef ENABLE_PRESSURE Pressure, +#endif Orientation, RotationVector, GameRotationVector, @@ -75,6 +77,12 @@ enum { NumSensors }; +#ifdef ENABLE_PRESSURE +#define LAST_HW_SENSOR Pressure +#else +#define LAST_HW_SENSOR RawMagneticField +#endif + /* Physical parameters of the sensors supported by Invensense MPL */ #define SENSORS_GYROSCOPE_HANDLE (ID_GY) #define SENSORS_RAW_GYROSCOPE_HANDLE (ID_RG) |