From 7e3c00eb2a154e567b680147d7b95140138a02b2 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 28 Feb 2024 15:57:47 +1100 Subject: [PATCH] Rover: move serial_manager parameters up to base class --- Rover/Parameters.cpp | 13 ++++++++++--- Rover/Parameters.h | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Rover/Parameters.cpp b/Rover/Parameters.cpp index 5f24887181c8c5..660bf4bb0955e7 100644 --- a/Rover/Parameters.cpp +++ b/Rover/Parameters.cpp @@ -274,9 +274,7 @@ const AP_Param::Info Rover::var_info[] = { GOBJECTN(_gcs.chan_parameters[6], gcs6, "SR6_", GCS_MAVLINK_Parameters), #endif - // @Group: SERIAL - // @Path: ../libraries/AP_SerialManager/AP_SerialManager.cpp - GOBJECT(serial_manager, "SERIAL", AP_SerialManager), + // AP_SerialManager was here // @Group: RNGFND // @Path: ../libraries/AP_RangeFinder/AP_RangeFinder.cpp @@ -909,4 +907,13 @@ void Rover::load_parameters(void) 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 Rover-4.6 + { &serial_manager, serial_manager.var_info, g.k_param_serial_manager_old }, +#endif + }; + + AP_Param::convert_toplevel_objects(toplevel_conversions, ARRAY_SIZE(toplevel_conversions)); + } diff --git a/Rover/Parameters.h b/Rover/Parameters.h index 19067a2c4b45b5..fdc817ff62413a 100644 --- a/Rover/Parameters.h +++ b/Rover/Parameters.h @@ -89,7 +89,7 @@ class Parameters { k_param_gcs2, // stream rates for SERIAL2 k_param_serial2_baud_old, // unused k_param_serial2_protocol, // deprecated, can be deleted - k_param_serial_manager, // serial manager library + k_param_serial_manager_old, // serial manager library k_param_cli_enabled_old, // unused k_param_gcs3, k_param_gcs_pid_mask,