GCS_MAVLink: don't report SCALED_PRESSURE2 with a non-existant airspeed sensor

This commit is contained in:
Andrew Tridgell 2019-04-08 10:56:33 +10:00
parent d5df8312ad
commit f998a74adf
1 changed files with 1 additions and 1 deletions

View File

@ -1813,7 +1813,7 @@ void GCS_MAVLINK::send_scaled_pressure_instance(uint8_t instance, void (*send_fn
float press_diff = 0; // pascal
AP_Airspeed *airspeed = AP_Airspeed::get_singleton();
if (airspeed != nullptr &&
instance < AIRSPEED_MAX_SENSORS) {
airspeed->enabled(instance)) {
press_diff = airspeed->get_differential_pressure(instance) * 0.01f;
have_data = true;
}