sensor: si7006: fixed temperature conversion
The driver was incorrectly converting the temperature samples. According to Si7006-A20 rev. 1.2 datasheet, section 5.1.2. Measuring Temperature, the offset -46.85 must be applied. Signed-off-by: Max Payne <forgge@gmail.com> Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com>
This commit is contained in:
parent
3bb73adbea
commit
0bc4370689
1 changed files with 2 additions and 2 deletions
|
@ -105,8 +105,8 @@ static int si7006_channel_get(struct device *dev, enum sensor_channel chan,
|
|||
|
||||
if (chan == SENSOR_CHAN_AMBIENT_TEMP) {
|
||||
|
||||
s32_t temp_ucelcius = ((17572 * (s32_t)si_data->temperature)
|
||||
/ 65536) * 10000;
|
||||
s32_t temp_ucelcius = (((17572 * (s32_t)si_data->temperature)
|
||||
/ 65536) - 4685) * 10000;
|
||||
|
||||
val->val1 = temp_ucelcius / 1000000;
|
||||
val->val2 = temp_ucelcius % 1000000;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue