diff options
author | Rob Barnes <robbarnes@google.com> | 2021-09-08 14:09:10 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-14 01:36:33 +0000 |
commit | 6c8d7c8cf289ef2483ce595aa33119f313c45b18 (patch) | |
tree | 98c8c1ebbc02ff7a1307dda0a9be02d6f1a3750d | |
parent | eefb43a9f85901a135f9f01e963d17efa0986713 (diff) | |
download | chrome-ec-6c8d7c8cf289ef2483ce595aa33119f313c45b18.tar.gz |
bmi3xx: Fix sensor_num in ec_response_motion_sensor_data
The sensor_num should match the sensor index of the sensor that produced
the data. It was incorrectly set to sens_cnt, which is just the offset
of the sensors on the bmi3xx.
BUG=b:195264765, b:197186738
TEST=Passed the following tests on guybrush:
iioservice_simpleclient --channels='accel_x' --frequency=12.5 --device_id=2 --samples=1
run cts -m CtsSensorTestCases -t android.hardware.cts.SensorBatchingTests#testAccelUncalibrated_50hz_batching
BRANCH=None
Change-Id: Id51ea52a0426fc50a5001437e720eedf41c333ad
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3150058
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
-rw-r--r-- | driver/accelgyro_bmi3xx.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/driver/accelgyro_bmi3xx.c b/driver/accelgyro_bmi3xx.c index 08020f926a..90641a209e 100644 --- a/driver/accelgyro_bmi3xx.c +++ b/driver/accelgyro_bmi3xx.c @@ -404,8 +404,7 @@ int bmi3_parse_fifo_data(struct motion_sensor_t *s, struct bmi3_fifo_frame vect.data[Y] = v[Y]; vect.data[Z] = v[Z]; vect.flags = 0; - vect.sensor_num = sens_cnt; - + vect.sensor_num = s - motion_sensors + sens_cnt; motion_sense_fifo_stage_data(&vect, sens_output, 3, last_ts); } |