From ba312856eac505e3c803ee7d38f20d4e2c9268fe Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 12 Nov 2014 11:26:49 +1100 Subject: [PATCH] Plane: provide a temperature to baro from the airspeed sensor --- ArduPlane/sensors.pde | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ArduPlane/sensors.pde b/ArduPlane/sensors.pde index 75fa56814f..f452b4de1c 100644 --- a/ArduPlane/sensors.pde +++ b/ArduPlane/sensors.pde @@ -37,12 +37,22 @@ static void read_airspeed(void) Log_Write_Airspeed(); } calc_airspeed_errors(); + + // supply a new temperature to the barometer from the digital + // airspeed sensor if we can + float temperature; + if (airspeed.get_temperature(temperature)) { + barometer.set_external_temperature(temperature); + } } } static void zero_airspeed(void) { airspeed.calibrate(); + read_airspeed(); + // update barometric calibration with new airspeed supplied temperature + barometer.update_calibration(); gcs_send_text_P(SEVERITY_LOW,PSTR("zero airspeed calibrated")); }