Copter: fixed use of configured() vs configured_in_storage()

This commit is contained in:
Andrew Tridgell 2022-05-12 08:04:37 +10:00 committed by Peter Barker
parent d512dc0b00
commit 161ab4b330
2 changed files with 9 additions and 9 deletions

View File

@ -1507,10 +1507,10 @@ void Copter::convert_lgr_parameters(void)
// this shouldn't happen
return;
}
if (servo_min->configured_in_storage() ||
servo_max->configured_in_storage() ||
servo_trim->configured_in_storage() ||
servo_reversed->configured_in_storage()) {
if (servo_min->configured() ||
servo_max->configured() ||
servo_trim->configured() ||
servo_reversed->configured()) {
// has been previously saved, don't upgrade
return;
}
@ -1601,7 +1601,7 @@ void Copter::convert_tradheli_parameters(void) const
// make sure the pointer is valid
if (ap2 != nullptr) {
// see if we can load it from EEPROM
if (!ap2->configured_in_storage()) {
if (!ap2->configured()) {
// the new parameter is not in storage so set generic swash
AP_Param::set_and_save_by_name("H_SW_TYPE", SwashPlateType::SWASHPLATE_TYPE_H3);
}
@ -1659,7 +1659,7 @@ void Copter::convert_tradheli_parameters(void) const
// make sure the pointer is valid
if (ap2 != nullptr) {
// see if we can load it from EEPROM
if (!ap2->configured_in_storage()) {
if (!ap2->configured()) {
// the new parameter is not in storage so set generic swash
AP_Param::set_and_save_by_name("H_SW_TYPE", SwashPlateType::SWASHPLATE_TYPE_H3);
}
@ -1676,7 +1676,7 @@ void Copter::convert_tradheli_parameters(void) const
// make sure the pointer is valid
if (ap2 != nullptr) {
// see if we can load it from EEPROM
if (!ap2->configured_in_storage()) {
if (!ap2->configured()) {
// the new parameter is not in storage so set generic swash
AP_Param::set_and_save_by_name("H_SW2_TYPE", SwashPlateType::SWASHPLATE_TYPE_H3);
}
@ -1749,7 +1749,7 @@ void Copter::convert_fs_options_params(void) const
enum ap_var_type ptype;
AP_Int32 *fs_opt = (AP_Int32 *)AP_Param::find("FS_OPTIONS", &ptype);
if (fs_opt == nullptr || fs_opt->configured_in_storage() || ptype != AP_PARAM_INT32) {
if (fs_opt == nullptr || fs_opt->configured() || ptype != AP_PARAM_INT32) {
return;
}

View File

@ -51,7 +51,7 @@ void Copter::init_rc_out()
motors->set_update_rate(g.rc_speed);
#if FRAME_CONFIG != HELI_FRAME
if (channel_throttle->configured_in_storage()) {
if (channel_throttle->configured()) {
// throttle inputs setup, use those to set motor PWM min and max if not already configured
motors->convert_pwm_min_max_param(channel_throttle->get_radio_min(), channel_throttle->get_radio_max());
} else {