drivers/sensor: iis2mdc: Fix the temperature in celsius
Fix the formula to translate raw temperature read from register to Celsius. Signed-off-by: Armando Visconti <armando.visconti@st.com>
This commit is contained in:
parent
99b97f5ff4
commit
4250028483
1 changed files with 1 additions and 1 deletions
|
@ -205,7 +205,7 @@ static int iis2mdc_sample_fetch_temp(const struct device *dev)
|
|||
}
|
||||
|
||||
/* formula is temp = 25 + (temp / 8) C */
|
||||
temp = (sys_le16_to_cpu(raw_temp.i16bit) & 0x8FFF);
|
||||
temp = sys_le16_to_cpu(raw_temp.i16bit);
|
||||
iis2mdc->temp_sample = 2500 + (temp * 100) / 8;
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue