From bc914006bf0d20da3ab2f6b10401ee6d2acfec8e Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 14:00:33 +1000 Subject: [PATCH] AP_Compass: remove primary compass parameter conversion Converted the old COMPASS_PRIMARY into the device-id priority list. Added Feb-2020 and present in the 4.3.0 release, so anybody running 4.3.0 or later has already had it applied. Note that the conversion sat inside Compass::init(), below its if (!_enabled) { return; } early return, so "present in the release" is not quite the same as "has run". A user who has had COMPASS_ENABLE=0 for every release from 4.3 onwards never reached the conversion, and if they enable the compass after moving to 4.8 their old COMPASS_PRIMARY selection is not honoured. That is judged too unlikely - and the parameter too old - to keep the conversion for. --- libraries/AP_Compass/AP_Compass.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/libraries/AP_Compass/AP_Compass.cpp b/libraries/AP_Compass/AP_Compass.cpp index 4b971385e1c..71b0ef53648 100644 --- a/libraries/AP_Compass/AP_Compass.cpp +++ b/libraries/AP_Compass/AP_Compass.cpp @@ -719,24 +719,6 @@ void Compass::init() } #if COMPASS_MAX_INSTANCES > 1 - // PARAMETER_CONVERSION - Added: Feb-2020 for ArduPilot-4.0 - // Look if there was a primary compass setup in previous version - // if so and the primary compass is not set in current setup - // make the devid as primary. - if (_priority_did_stored_list[Priority(0)] == 0) { - uint16_t k_param_compass; - if (AP_Param::find_top_level_key_by_pointer(this, k_param_compass)) { - const AP_Param::ConversionInfo primary_compass_old_param = {k_param_compass, 12, AP_PARAM_INT8, ""}; - AP_Int8 value; - value.set(0); - bool primary_param_exists = AP_Param::find_old_parameter(&primary_compass_old_param, &value); - int8_t oldvalue = value.get(); - if ((oldvalue!=0) && (oldvalue