From 2e75d79e59b5c23faf757d17954fd25c19982bee 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 | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/libraries/AP_Airspeed/Airspeed_Calibration.cpp b/libraries/AP_Airspeed/Airspeed_Calibration.cpp index 0a416d2150e1f..0374521df8203 100644 --- a/libraries/AP_Airspeed/Airspeed_Calibration.cpp +++ b/libraries/AP_Airspeed/Airspeed_Calibration.cpp @@ -171,23 +171,34 @@ 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