From 3085816a16b44fb3c19734b5305949ab3d89cbd4 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 28 Feb 2024 11:48:25 +1100 Subject: [PATCH] ArduPlane: move serial_manager parameters up to base class --- ArduPlane/Parameters.cpp | 13 ++++++++++--- ArduPlane/Parameters.h | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ArduPlane/Parameters.cpp b/ArduPlane/Parameters.cpp index b6db6ba4ae..53ad53307e 100644 --- a/ArduPlane/Parameters.cpp +++ b/ArduPlane/Parameters.cpp @@ -29,9 +29,7 @@ const AP_Param::Info Plane::var_info[] = { // @User: Advanced GSCALAR(sysid_my_gcs, "SYSID_MYGCS", 255), - // @Group: SERIAL - // @Path: ../libraries/AP_SerialManager/AP_SerialManager.cpp - GOBJECT(serial_manager, "SERIAL", AP_SerialManager), + // AP_SerialManager was here // @Param: AUTOTUNE_LEVEL // @DisplayName: Autotune level @@ -1535,4 +1533,13 @@ void Plane::load_parameters(void) #if HAL_LOGGING_ENABLED AP_Param::convert_class(g.k_param_logger, &logger, logger.var_info, 0, true); #endif + + static const AP_Param::TopLevelObjectConversion toplevel_conversions[] { +#if AP_SERIALMANAGER_ENABLED + // PARAMETER_CONVERSION - Added: Feb-2024 for Plane-4.6 + { &serial_manager, serial_manager.var_info, Parameters::k_param_serial_manager_old }, +#endif + }; + + AP_Param::convert_toplevel_objects(toplevel_conversions, ARRAY_SIZE(toplevel_conversions)); } diff --git a/ArduPlane/Parameters.h b/ArduPlane/Parameters.h index 49f3822f83..dacc015496 100644 --- a/ArduPlane/Parameters.h +++ b/ArduPlane/Parameters.h @@ -202,7 +202,7 @@ public: k_param_curr_amp_offset, k_param_NavEKF, // deprecated - remove k_param_mission, // mission library - k_param_serial_manager, // serial manager library + k_param_serial_manager_old, // serial manager library k_param_NavEKF2_old, // deprecated - remove k_param_land_pre_flare_alt, // unused - moved to AP_Landing k_param_land_pre_flare_airspeed = 149, // unused - moved to AP_Landing