STMicroelectronics / STMems_Linux_IIO_drivers

DISCONTINUED (October 2022): the maintenance for this repository has been discontinued. Please refer to https://github.com/STMicroelectronics/st-mems-android-linux-drivers-iio for the up-to-date drivers repository. This repository contains Linux Kernel (v3.10, v3.14, v3.18, v4.9, v4.14, v4.19) including STMicroelectronics MEMS IIO sensor support
Other
76 stars 43 forks source link

ISM330DLC: Bug delay accelerometer #13

Open jbiemar opened 3 years ago

jbiemar commented 3 years ago

I found a bug in the ISM330DLC driver. st_ism330dlc_core.c

Current Behavior

When I try to read the accelerometer in Linux with sudo cat /sys/bus/iio/devices/iio:device1/in_accel_x_raw it always return 0. With y and z too.

When I perform a selftest, it pass and then I have new value in _in_accel_x-y-zraw.

I found that with the default frequency (13Hz), the delay at line 1653 is too short. 1/13 = 76ms and it's 40ms in the driver.

Possible Solution

I change this delay to 120ms and it's working well.