driver/sensor: lsm6dsl: Fix attribute setting for gyroscope fs
The API for setting the gyroscope full scale attruibute requires the argument in radians/s. Signed-off-by: Armando Visconti <armando.visconti@st.com>
This commit is contained in:
parent
c81efe25d5
commit
5ad0d27bd1
|
@ -282,7 +282,7 @@ static int lsm6dsl_gyro_config(struct device *dev, enum sensor_channel chan,
|
|||
switch (attr) {
|
||||
#ifdef LSM6DSL_GYRO_FS_RUNTIME
|
||||
case SENSOR_ATTR_FULL_SCALE:
|
||||
return lsm6dsl_gyro_range_set(dev, sensor_ms2_to_g(val));
|
||||
return lsm6dsl_gyro_range_set(dev, sensor_rad_to_degrees(val));
|
||||
#endif
|
||||
#ifdef LSM6DSL_GYRO_ODR_RUNTIME
|
||||
case SENSOR_ATTR_SAMPLING_FREQUENCY:
|
||||
|
|
|
@ -223,7 +223,7 @@ void main(void)
|
|||
struct sensor_value g_fs_attr;
|
||||
|
||||
/* set full scale to 245dps for accel */
|
||||
sensor_g_to_ms2(245, &g_fs_attr);
|
||||
sensor_degrees_to_rad(245, &g_fs_attr);
|
||||
|
||||
if (sensor_attr_set(accel_dev, SENSOR_CHAN_GYRO_XYZ,
|
||||
SENSOR_ATTR_FULL_SCALE, &g_fs_attr) < 0) {
|
||||
|
|
Loading…
Reference in a new issue