From 322551b13b422f7e414930ad14e7cce1358f8ab3 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Sat, 27 Apr 2024 09:08:12 +0200 Subject: [PATCH] sensors/adxl372_uorb: wait for data ready in thread --- drivers/sensors/adxl372_uorb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/sensors/adxl372_uorb.c b/drivers/sensors/adxl372_uorb.c index 627be57b5b..cbfe7a0f43 100644 --- a/drivers/sensors/adxl372_uorb.c +++ b/drivers/sensors/adxl372_uorb.c @@ -493,6 +493,10 @@ static int adxl372_thread(int argc, FAR char **argv) if (priv->enabled) { + /* Wait for data ready */ + + while (!(adxl372_getreg8(priv, ADXL372_STATUS) & 0x01)); + adxl372_getregs(priv, ADXL372_XDATA_H, (FAR uint8_t *)data, 6); accel.timestamp = sensor_get_timestamp();