mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
Fix a bug in calculating air temperature in baro sensor when it goes below 20
deg C.
This commit is contained in:
parent
63285ea451
commit
f06439ecf5
@ -144,7 +144,7 @@ int32_t PIOS_MS5611_ReadADC(void)
|
||||
|
||||
RawTemperature = (Data[0] << 16) | (Data[1] << 8) | Data[2];
|
||||
|
||||
deltaTemp = RawTemperature - (CalibData.C[4] << 8);
|
||||
deltaTemp = ((int32_t) RawTemperature) - (CalibData.C[4] << 8);
|
||||
Temperature = 2000l + ((deltaTemp * CalibData.C[5]) >> 23);
|
||||
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user