Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ism330dhcx temperature in wrong format #10

Open
Paplewski opened this issue Aug 25, 2021 · 1 comment
Open

ism330dhcx temperature in wrong format #10

Paplewski opened this issue Aug 25, 2021 · 1 comment

Comments

@Paplewski
Copy link

Paplewski commented Aug 25, 2021

According to the IIO ABI documentation the temperature output units are standardized:

Units after application of scale and offset are milli degrees Celsius.

Applying the following patch solves the problem.

Subject: [PATCH 1/1] Fix temperature scaling issue

According to the iio ABI documentation the units of the temperature
is mili degrees Celsius.
---
 drivers/iio/imu/st_ism330dhcx/st_ism330dhcx_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/imu/st_ism330dhcx/st_ism330dhcx_core.c b/drivers/iio/imu/st_ism330dhcx/st_ism330dhcx_core.c
index 07e8e2d77f5f..9939c65a1e51 100644
--- a/drivers/iio/imu/st_ism330dhcx/st_ism330dhcx_core.c
+++ b/drivers/iio/imu/st_ism330dhcx/st_ism330dhcx_core.c
@@ -781,7 +781,7 @@ static int st_ism330dhcx_read_raw(struct iio_dev *iio_dev,
  case IIO_CHAN_INFO_SCALE:
  switch (ch->type) {
  case IIO_TEMP:
- *val = 1;
+ *val = 1000;
  *val2 = ST_ISM330DHCX_TEMP_GAIN;
  ret = IIO_VAL_FRACTIONAL;
  break;

Edit: Currently the units are degrees C

@mariotesi
Copy link
Contributor

mariotesi commented Jan 11, 2023

pls consider update driver are moved on new github repository:
https://github.com/STMicroelectronics/st-mems-android-linux-drivers-iio)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants