Browse Source

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

apm_2208
Andrew Tridgell 3 years ago committed by Peter Barker
parent
commit
161ab4b330
  1. 16
      ArduCopter/Parameters.cpp
  2. 2
      ArduCopter/radio.cpp

16
ArduCopter/Parameters.cpp

@ -1507,10 +1507,10 @@ void Copter::convert_lgr_parameters(void) @@ -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 @@ -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 @@ -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 @@ -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 @@ -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;
}

2
ArduCopter/radio.cpp

@ -51,7 +51,7 @@ void Copter::init_rc_out() @@ -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 {

Loading…
Cancel
Save