ArduPlane: rename and make enum RC_Channel::ControlType

Type:: is too generic; get_type should probably be get_control_type
This commit is contained in:
Peter Barker 2022-02-25 17:01:06 +11:00 committed by Peter Barker
parent 37af7e5166
commit 13fa1e30ad
2 changed files with 4 additions and 3 deletions

View File

@ -165,10 +165,10 @@ void Plane::calc_airspeed_errors()
const float control_max = channel_throttle->get_range();
const float control_in = get_throttle_input();
switch (channel_throttle->get_type()) {
case RC_Channel::RC_CHANNEL_TYPE_ANGLE:
case RC_Channel::ControlType::ANGLE:
control_min = -control_max;
break;
case RC_Channel::RC_CHANNEL_TYPE_RANGE:
case RC_Channel::ControlType::RANGE:
control_mid = channel_throttle->get_control_mid();
break;
}

View File

@ -143,7 +143,8 @@ float Plane::get_throttle_input(bool no_deadzone) const
*/
float Plane::get_adjusted_throttle_input(bool no_deadzone) const
{
if ((plane.channel_throttle->get_type() != RC_Channel::RC_CHANNEL_TYPE_RANGE) || (g2.flight_options & FlightOptions::CENTER_THROTTLE_TRIM) == 0) {
if ((plane.channel_throttle->get_type() != RC_Channel::ControlType::RANGE) ||
(g2.flight_options & FlightOptions::CENTER_THROTTLE_TRIM) == 0) {
return get_throttle_input(no_deadzone);
}
float ret = channel_throttle->get_range() * throttle_curve(aparm.throttle_cruise * 0.01, 0, 0.5 + 0.5*channel_throttle->norm_input());