diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index 9d99118956..7319c26a9f 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -879,7 +879,6 @@ private: #endif void convert_lgr_parameters(void); void convert_tradheli_parameters(void) const; - void convert_fs_options_params(void) const; // precision_landing.cpp void init_precland(); diff --git a/ArduCopter/Parameters.cpp b/ArduCopter/Parameters.cpp index 9fce7ed53a..780cba7238 100644 --- a/ArduCopter/Parameters.cpp +++ b/ArduCopter/Parameters.cpp @@ -1335,10 +1335,6 @@ void Copter::load_parameters(void) convert_lgr_parameters(); #endif - // convert fs_options parameters - // PARAMETER_CONVERSION - Added: Nov-2019 - convert_fs_options_params(); - #if MODE_RTL_ENABLED == ENABLED // PARAMETER_CONVERSION - Added: Sep-2021 g.rtl_altitude.convert_parameter_width(AP_PARAM_INT16); @@ -1867,35 +1863,3 @@ void Copter::convert_tradheli_parameters(void) const } #endif - -void Copter::convert_fs_options_params(void) const -{ - // PARAMETER_CONVERSION - Added: Nov-2019 - - // If FS_OPTIONS has already been configured and we don't change it. - enum ap_var_type ptype; - AP_Int32 *fs_opt = (AP_Int32 *)AP_Param::find("FS_OPTIONS", &ptype); - - if (fs_opt == nullptr || fs_opt->configured() || ptype != AP_PARAM_INT32) { - return; - } - - // Variable to capture the new FS_OPTIONS setting - int32_t fs_options_converted = (int32_t)FailsafeOption::GCS_CONTINUE_IF_PILOT_CONTROL; - - // If FS_THR_ENABLED is 2 (continue mission), change to RTL and add continue mission to the new FS_OPTIONS parameter - if (g.failsafe_throttle == FS_THR_ENABLED_CONTINUE_MISSION) { - fs_options_converted |= int32_t(FailsafeOption::RC_CONTINUE_IF_AUTO); - AP_Param::set_and_save_by_name("FS_THR_ENABLE", FS_THR_ENABLED_ALWAYS_RTL); - } - - // If FS_GCS_ENABLED is 2 (continue mission), change to RTL and add continue mission to the new FS_OPTIONS parameter - if (g.failsafe_gcs == FS_GCS_ENABLED_CONTINUE_MISSION) { - fs_options_converted |= int32_t(FailsafeOption::GCS_CONTINUE_IF_AUTO); - AP_Param::set_and_save_by_name("FS_GCS_ENABLE", FS_GCS_ENABLED_ALWAYS_RTL); - } - - // Write the new value to FS_OPTIONS - // AP_Param::set_and_save_by_name("FS_OPTIONS", fs_options_converted); - fs_opt->set_and_save(fs_options_converted); -}