sensor_lis2dw: Fix fifo_empty check on lis2dw chips

Fix inverted check for fifo empty.  The fifo is empty when the number
of entries in the fifo is zero.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2025-10-06 13:32:01 -04:00
parent cba7a285e4
commit 6269dda56b

View File

@@ -141,7 +141,7 @@ lis2dw_query(struct lis2dw *ax, uint8_t oid)
if (ax->model == LIS3DH)
fifo_empty = fifo[1] & 0x20;
else
fifo_empty = fifo[1] & 0x3F;
fifo_empty = ((fifo[1] & 0x3F) == 0);
fifo_ovrn = fifo[1] & 0x40;
@@ -167,7 +167,7 @@ lis2dw_query(struct lis2dw *ax, uint8_t oid)
if (ax->model == LIS3DH)
fifo_empty = fifo[0] & 0x20;
else
fifo_empty = fifo[0] & 0x3F;
fifo_empty = ((fifo[0] & 0x3F) == 0);
fifo_ovrn = fifo[0] & 0x40;