ArduPlane: move airspeed update to library

This commit is contained in:
DOMINATOR\Eugene 2018-11-16 18:15:54 +02:00 committed by Andrew Tridgell
parent cdbffb4ecc
commit 802ae94e2c
1 changed files with 1 additions and 13 deletions

View File

@ -65,19 +65,7 @@ void Plane::accel_cal_update() {
*/
void Plane::read_airspeed(void)
{
if (airspeed.enabled()) {
airspeed.read();
if (should_log(MASK_LOG_IMU)) {
DataFlash.Log_Write_Airspeed(airspeed);
}
// 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);
}
}
airspeed.update(should_log(MASK_LOG_IMU));
// we calculate airspeed errors (and thus target_airspeed_cm) even
// when airspeed is disabled as TECS may be using synthetic