drivers: sensor: adi: adxl345: use selected range for conversion
When running the samples/sensor/accel_trig sample with a adxl345 sensor
the logged output values were doubled compared to the expected values.
The sensor_channel_get() path calls adxl345_accel_convert which did not
handle the configured g-range, resulting in invalid sample values except
for the +/-16g range. To fix this issue the configured range is taken
into account and different conversion factors are applied.
adxl345_accel_convert is also made static. It is not used by another file.
Signed-off-by: Stefan Schmidt <kontakt@stefanschmidt-embedded.de>
2 files changed