driver/sensor: lis2mdl: Fix the temperature fractional value
The temperature fractional value has to be assigned multiplied by 10^6. Signed-off-by: Armando Visconti <armando.visconti@st.com>
This commit is contained in:
parent
3a7c37ab29
commit
89199dcbaf
1 changed files with 1 additions and 1 deletions
|
@ -148,7 +148,7 @@ static void lis2mdl_channel_get_temp(struct device *dev,
|
||||||
struct lis2mdl_data *drv_data = dev->driver_data;
|
struct lis2mdl_data *drv_data = dev->driver_data;
|
||||||
|
|
||||||
val->val1 = drv_data->temp_sample / 100;
|
val->val1 = drv_data->temp_sample / 100;
|
||||||
val->val2 = drv_data->temp_sample % 100;
|
val->val2 = (drv_data->temp_sample % 100) * 10000;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lis2mdl_channel_get(struct device *dev, enum sensor_channel chan,
|
static int lis2mdl_channel_get(struct device *dev, enum sensor_channel chan,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue