-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sensor: adxl345: Decoder-related bug-fixes #83476
sensor: adxl345: Decoder-related bug-fixes #83476
Conversation
e6fade9
to
a7699d9
Compare
Used by the sensor-shell in order to retrieve values, otherwise it crashes. Signed-off-by: Luis Ubieda <luisf@croxel.com>
The following fixes have been applied to this decoder: - The Q-scale factor was fixed, both for full-scale and non full-scale modes. - The data-type decoded is struct sensor_three_axis_data, as it should for read/decode API. Signed-off-by: Luis Ubieda <luisf@croxel.com>
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>
Have the application enable this feature explicitcly, so that simple applications do not need to disable this to get the expected behavior. Signed-off-by: Luis Ubieda <luisf@croxel.com>
a7699d9
to
1868211
Compare
Just rebased. Need to create a GH issue to get this backported into v4.0-branch |
Tested and it works for me using the ADXL345. |
Created issue and added backport label |
I also tested this on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ubieda !
I tested this out with the following and it looks good:
$ west build -p -b apard32690//m4 --shield pmod_acl samples/subsys/shell/shell_module/ -- -DCONFIG_SENSOR=y -DCONFIG_SENSOR_ASYNC_API=y -DCONFIG_SENSOR_SHELL=y
@dimitrije-lilic please take a look
Description
This PR applies various fixes to the ADXL345 driver:
adxl345_get_size_info()
used, for instance, by the Sensor Shell.adxlXXX_decode_sample()
to usesensor_three_axis_data
.Fixes #84252
Testing
Run Shell sample with sensor commands on the ADXL345 (tested both for SPI and I2C). The following evidence is for I2C:
west build -b nrf52840dk/nrf52840 samples/subsys/shell/shell_module
samples/subsys/shell/shell_module/boards/nrf52840dk_nrf52840.overlay
)samples/subsys/shell/shell_module/boards/nrf52840dk_nrf52840.conf
)