added circuit_breaker_enabled_by_val()

added and using circuit_breaker_enabled_by_val() where possible instead of circuit_breaker_enabled() which search for cbrk parameters by name, which is extensive process.
This commit is contained in:
bazooka joe
2019-09-22 13:55:40 -04:00
committed by Daniel Agar
parent c18104d48b
commit fb3a91cc4f
8 changed files with 34 additions and 18 deletions
@@ -265,7 +265,10 @@ private:
_param_mpc_thr_hover, /**< throttle at which vehicle is at hover equilibrium */
(ParamInt<px4::params::MPC_THR_CURVE>) _param_mpc_thr_curve, /**< throttle curve behavior */
(ParamInt<px4::params::MC_AIRMODE>) _param_mc_airmode
(ParamInt<px4::params::MC_AIRMODE>) _param_mc_airmode,
(ParamInt<px4::params::CBRK_RATE_CTRL>) _param_cbrk_rate_ctrl
)
bool _is_tailsitter{false};
@@ -131,7 +131,7 @@ MulticopterAttitudeControl::parameters_updated()
_man_tilt_max = math::radians(_param_mpc_man_tilt_max.get());
_actuators_0_circuit_breaker_enabled = circuit_breaker_enabled("CBRK_RATE_CTRL", CBRK_RATE_CTRL_KEY);
_actuators_0_circuit_breaker_enabled = circuit_breaker_enabled_by_val(_param_cbrk_rate_ctrl.get(), CBRK_RATE_CTRL_KEY);
}
void