beaf0230ba
When testing the bmi160 I've come across an issue where the readings didn't make sense to me. The issue comes from reading the BMI160_SAMPLE_BURST_READ_ADDR which is 0x0C assuming both accelerometer and gyroscope. At this point we would normally read 12 bytes (2 bytes per sample * 3 axes * 2 sensors). This reading takes place in bmi160_sample_fetch and begins writing to data->sample.raw Without this change, the first byte written is actually to the dummy byte which effectively gets tossed. The issue is that this is the GYR_X<7:0>(LSB) according to the BMI160 data sheet. When we later call either bmi160_gyr_channel_get or bmi160_acc_channel_get we're looking at sample.gyr and sample.acc (which is effectively shiften by 1 byte). This change gets rid of the dummy byte which re-alignes gyr with the start of the raw buffer. Signed-off-by: Yuval Peress <peress@chromium.org> |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
Kconfig | ||
bmi160.c | ||
bmi160.h | ||
bmi160_trigger.c |