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:
Armando Visconti 2019-09-20 15:08:21 +02:00 committed by Maureen Helm
commit 89199dcbaf

View file

@ -148,7 +148,7 @@ static void lis2mdl_channel_get_temp(struct device *dev,
struct lis2mdl_data *drv_data = dev->driver_data;
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,