Skip to content

Commit

Permalink
driver/sensor: lis2mdl: Fix the temperature fractional value
Browse files Browse the repository at this point in the history
The temperature fractional value has to be assigned multiplied
by 10^6.

Signed-off-by: Armando Visconti <[email protected]>
  • Loading branch information
avisconti authored and MaureenHelm committed Sep 26, 2019
1 parent 3a7c37a commit 89199dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/sensor/lis2mdl/lis2mdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 89199dc

Please sign in to comment.