File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
drivers/sensor/bosch/bmi323 Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -108,15 +108,6 @@ static void bosch_bmi323_value_to_sensor_value(struct sensor_value *result, int1
108
108
result -> val2 = frac_part ;
109
109
}
110
110
111
- static void bosch_bmi323_sensor_value_from_micro (struct sensor_value * result , int64_t micro )
112
- {
113
- int32_t int_part = (int32_t )(micro / 1000000 );
114
- int32_t frac_part = (int32_t )(micro % 1000000 );
115
-
116
- result -> val1 = int_part ;
117
- result -> val2 = frac_part ;
118
- }
119
-
120
111
static bool bosch_bmi323_value_is_valid (int16_t value )
121
112
{
122
113
return ((uint16_t )value == 0x8000 ) ? false : true;
@@ -995,9 +986,9 @@ static int bosch_bmi323_driver_api_fetch_temperature(const struct device *dev)
995
986
996
987
micro += IMU_BOSCH_DIE_TEMP_OFFSET_MICRO_DEG_CELSIUS ;
997
988
998
- bosch_bmi323_sensor_value_from_micro (& data -> temperature , micro );
989
+ ret = sensor_value_from_micro (& data -> temperature , micro );
999
990
1000
- data -> temperature_valid = true ;
991
+ data -> temperature_valid = ( ret == 0 ) ;
1001
992
1002
993
return 0 ;
1003
994
}
You can’t perform that action at this time.
0 commit comments