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 <luisf@croxel.com>
This commit is contained in:
parent
283b5197e6
commit
2a59a0282c
1 changed files with 2 additions and 0 deletions
|
|
@ -457,11 +457,13 @@ static int adxl345_init(const struct device *dev)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
#if CONFIG_ADXL345_STREAM
|
||||
rc = adxl345_reg_write_byte(dev, ADXL345_FIFO_CTL_REG, ADXL345_FIFO_STREAM_MODE);
|
||||
if (rc < 0) {
|
||||
LOG_ERR("FIFO enable failed\n");
|
||||
return -EIO;
|
||||
}
|
||||
#endif
|
||||
|
||||
rc = adxl345_reg_write_byte(dev, ADXL345_DATA_FORMAT_REG, ADXL345_RANGE_8G);
|
||||
if (rc < 0) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue