Skip to content

Commit 2a59a02

Browse files
ubiedakartben
authored andcommitted
sensor: adxl345: Only enable FIFO Stream with Sensor Stream is enabled
Otherwise with its default configuration (25-Hz, 32-level FIFO), getting individual samples could be up to 1-second old. Signed-off-by: Luis Ubieda <[email protected]>
1 parent 283b519 commit 2a59a02

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/sensor/adi/adxl345/adxl345.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,13 @@ static int adxl345_init(const struct device *dev)
457457
return -ENODEV;
458458
}
459459

460+
#if CONFIG_ADXL345_STREAM
460461
rc = adxl345_reg_write_byte(dev, ADXL345_FIFO_CTL_REG, ADXL345_FIFO_STREAM_MODE);
461462
if (rc < 0) {
462463
LOG_ERR("FIFO enable failed\n");
463464
return -EIO;
464465
}
466+
#endif
465467

466468
rc = adxl345_reg_write_byte(dev, ADXL345_DATA_FORMAT_REG, ADXL345_RANGE_8G);
467469
if (rc < 0) {

0 commit comments

Comments
 (0)