From 4f1f8aeb1ce83b825c537aba9edc85c8de4b1888 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 1 Dec 2024 14:18:15 +1100 Subject: [PATCH] AP_Airspeed: don't send AIRSPEED_AUTOCAL message when disabled we were wasting bandwidth sending this all the time also fixed to support calibration messages for 2nd airspeed sensor --- .../AP_Airspeed/Airspeed_Calibration.cpp | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/libraries/AP_Airspeed/Airspeed_Calibration.cpp b/libraries/AP_Airspeed/Airspeed_Calibration.cpp index 0a416d2150e1f..bea01f02fc239 100644 --- a/libraries/AP_Airspeed/Airspeed_Calibration.cpp +++ b/libraries/AP_Airspeed/Airspeed_Calibration.cpp @@ -171,23 +171,33 @@ void AP_Airspeed::update_calibration(const Vector3f &vground, int16_t max_airspe #if HAL_GCS_ENABLED void AP_Airspeed::send_airspeed_calibration(const Vector3f &vground) { + /* + the AIRSPEED_AUTOCAL message doesn't have an instance number + so we can only send it for one sensor at a time + */ + for (uint8_t i=0; i