Skip to content
Commit 74fc8fe0 authored by Marcin Niestroj's avatar Marcin Niestroj Committed by Maureen Helm
Browse files

sensor: lis2dh: fix SPI burst transfers



After switching to new SPI API there is no need to reserve first dummy
byte in buffer and ignore that in application later on. Instead two
buffers can be specified, which is how it is done already in lis2dh
driver. The problem is that dummy byte is still part of the buffer, but
it clearly should no longer be. As an example we write 0x7 (bits to
enable XYZ axes) into CTRL2 instead of CTRL1 register. When reading
measurements on the other hand we have filled buffer starting from 0,
instead of 1 as the driver code has expected.

Fix driver in all places that use burst transfers by removing first
dummy byte from input/output buffer.

Fixes: 2f7e6b6d ("drivers/sensors: Switch lis2dh driver to new SPI
  API")
Signed-off-by: default avatarMarcin Niestroj <m.niestroj@grinn-global.com>
parent d52a3660
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment