File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
drivers/sensor/adi/adxl367 Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -903,10 +903,10 @@ void adxl367_temp_convert(struct sensor_value *val, int16_t value)
903
903
static void adxl367_temp_convert (struct sensor_value * val , int16_t value )
904
904
#endif /*CONFIG_SENSOR_ASYNC_API*/
905
905
{
906
- int64_t temp_data = (value + ADXL367_TEMP_OFFSET ) * ADXL367_TEMP_SCALE ;
906
+ int64_t temp_data = (value - ADXL367_TEMP_25C ) ;
907
907
908
- val -> val1 = temp_data / ADXL367_TEMP_SCALE_DIV ;
909
- val -> val2 = temp_data % ADXL367_TEMP_SCALE_DIV ;
908
+ val -> val1 = temp_data / 54 /*temp sensitivity LSB/C*/ + 25 /*bias test conditions*/ ;
909
+ val -> val2 = temp_data % 54 * 10000 ;
910
910
}
911
911
912
912
static int adxl367_channel_get (const struct device * dev ,
@@ -932,6 +932,7 @@ static int adxl367_channel_get(const struct device *dev,
932
932
break ;
933
933
case SENSOR_CHAN_DIE_TEMP :
934
934
adxl367_temp_convert (val , data -> temp_val );
935
+ break ;
935
936
default :
936
937
return - ENOTSUP ;
937
938
}
You can’t perform that action at this time.
0 commit comments