Skip to content

Commit

Permalink
fix aux func & switch pos
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleRos committed Jul 10, 2024
1 parent 0eb54d1 commit aa55128
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
18 changes: 11 additions & 7 deletions libraries/AP_Quicktune/AP_Quicktune.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ void AP_Quicktune::update(){
if (have_pilot_input()){
last_pilot_input = get_time();
}
uint8_t pos;
bool sw_pos = rc().get_aux_cached(RC_Channel::AUX_FUNC::QUICKTUNE, pos);
if (!sw_pos){
uint8_t sw_pos;
bool sw_set = rc().get_aux_cached(RC_Channel::AUX_FUNC::QUICKTUNE, sw_pos);
if (!sw_set){
return;
}
int8_t sw_pos_tune = 1;
Expand Down Expand Up @@ -466,7 +466,8 @@ AP_Quicktune::param_s AP_Quicktune::get_pname(AP_Quicktune::axis_names axis, AP_
return param_s::RLL_P;
} return param_s::RLL_D;
default:
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
GCS_SEND_TEXT(MAV_SEVERITY_EMERGENCY, "INTERNAL ERROR (469)");
// INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
return param_s::END;
}
}
Expand Down Expand Up @@ -507,7 +508,8 @@ float AP_Quicktune::get_param_value(AP_Quicktune::param_s param)
case param_s::YAW_D:
return attitude_control->get_rate_yaw_pid().kD();
default:
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
GCS_SEND_TEXT(MAV_SEVERITY_EMERGENCY, "INTERNAL ERROR (511)");
// INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
return 0.0;
break;
}
Expand Down Expand Up @@ -545,7 +547,8 @@ void AP_Quicktune::set_param_value(AP_Quicktune::param_s param, float value)
attitude_control->get_rate_yaw_pid().kD(value);
return;
default:
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
GCS_SEND_TEXT(MAV_SEVERITY_EMERGENCY, "INTERNAL ERROR (550)");
// INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
return;
}
}
Expand Down Expand Up @@ -582,7 +585,8 @@ void AP_Quicktune::set_and_save_param_value(AP_Quicktune::param_s param, float v
attitude_control->get_rate_yaw_pid().kD_s(value);
return;
default:
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
GCS_SEND_TEXT(MAV_SEVERITY_EMERGENCY, "INTERNAL ERROR (588)");
// INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
return;
}
}
Expand Down
1 change: 1 addition & 0 deletions libraries/RC_Channel/RC_Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ void RC_Channel::init_aux_function(const AUX_FUNC ch_option, const AuxSwitchPos
#if HAL_MOUNT_ENABLED
case AUX_FUNC::MOUNT_LRF_ENABLE:
#endif
case AUX_FUNC::QUICKTUNE:
break;

// not really aux functions:
Expand Down

0 comments on commit aa55128

Please sign in to comment.