AP_Baro: fixed a build warning

This commit is contained in:
Andrew Tridgell 2013-05-02 21:31:04 +10:00
parent 168f76e76c
commit 26bf636541
1 changed files with 3 additions and 3 deletions

View File

@ -35,16 +35,16 @@ void AP_Baro_HIL::setHIL(float altitude_msl)
{
// approximate a barometer. This uses the typical base pressure in
// Canberra, Australia
const float Temp = 312;
const float temperature = 312;
float y = (altitude_msl - 584.0) / 29.271267;
y /= (Temp / 10.0) + 273.15;
y /= (temperature / 10.0) + 273.15;
y = 1.0/exp(y);
y *= 95446.0;
_count++;
_pressure_sum += y;
_temperature_sum += Temp;
_temperature_sum += temperature;
if (_count == 128) {
// we have summed 128 values. This only happens
// when we stop reading the barometer for a long time