ADXL sensor drivers attempt to modify config struct at run-time #83853
Labels
area: Sensors
Sensors
bug
The issue is a bug, or the PR is fixing a bug
platform: ADI
Analog Devices, Inc.
Describe the bug
Drivers for ADXL345 and ADXL372 attempt to modify the config struct when setting ODR attribute:
zephyr/drivers/sensor/adi/adxl345/adxl345.c
Line 260 in 99a63a7
zephyr/drivers/sensor/adi/adxl372/adxl372.c
Line 578 in 99a63a7
Since config struct is constant, modifying it triggers a fault.
This is present since 4.0.0:
To Reproduce
Build
samples/drivers/sensor/accel_polling
with either of these sensors, and it will crash, since this sample sets the ODR.Expected behavior
Config struct is not modified at run-time.
The text was updated successfully, but these errors were encountered: