zephyr/drivers/sensor/sensirion
Zach Thomas 7e23a18980 drivers: sensor: scd4x: fix int overflow on val2 for temp and hum
The scd4x_channel_get function converts raw word values to
struct sensor_value's per the datasheet. The calculation for val2 of a
struct sensor_value `val->val2 = ((tmp_val % 0xFFFF) * 1000000) / 0xFFFF;`
can overflow the max of int32_t, resulting in an incorrect
sensor_value.
Fix it by changing the type of tmp_val to int64_t.

Signed-off-by: Zach Thomas <zach.thomas1.zt@gmail.com>
2025-02-21 04:39:42 +01:00
..
scd4x drivers: sensor: scd4x: fix int overflow on val2 for temp and hum 2025-02-21 04:39:42 +01:00
sgp40 drivers: sensor: Place API into iterable section 2024-12-02 22:04:55 +00:00
sht3xd drivers: sensor: Place API into iterable section 2024-12-02 22:04:55 +00:00
sht4x drivers: sensor: Place API into iterable section 2024-12-02 22:04:55 +00:00
shtcx drivers: sensor: Place API into iterable section 2024-12-02 22:04:55 +00:00
sts4x drivers: sensor: Place API into iterable section 2024-12-02 22:04:55 +00:00
CMakeLists.txt drivers: sensor: SCD4x Add driver 2024-11-18 19:38:10 -05:00
Kconfig drivers: sensor: SCD4x Add driver 2024-11-18 19:38:10 -05:00