drivers/sensor: lsm6ds0: Fix SENSOR_DEG2RAD_DOUBLE macro

In order to convert from degrees to radiants the SENSOR_DEG2RAD_DOUBLE
macro must divide the argument by 180 degrees and multiply by PI
radiants, and not the other way around. Please note that same macro
is already defined in the correct way in other sensor drivers as well.
(Fix #39483)

Signed-off-by: Armando Visconti <armando.visconti@st.com>
This commit is contained in:
Armando Visconti 2021-11-02 10:27:10 +01:00 committed by Maureen Helm
commit aa3f3d943a

View file

@ -314,7 +314,7 @@
#define SENSOR_G_DOUBLE (SENSOR_G / 1000000.0)
#define SENSOR_PI_DOUBLE (SENSOR_PI / 1000000.0)
#define SENSOR_DEG2RAD_DOUBLE (180.0 / SENSOR_PI_DOUBLE)
#define SENSOR_DEG2RAD_DOUBLE (SENSOR_PI_DOUBLE / 180)
#if defined(CONFIG_LSM6DS0_ACCEL_ENABLE_X_AXIS)
#define LSM6DS0_ACCEL_ENABLE_X_AXIS 1