Browse Source

ArduPlane: rename and make enum RC_Channel::ControlType

Type:: is too generic; get_type should probably be get_control_type
gps-1.3.1
Peter Barker 3 years ago committed by Peter Barker
parent
commit
13fa1e30ad
  1. 4
      ArduPlane/navigation.cpp
  2. 3
      ArduPlane/reverse_thrust.cpp

4
ArduPlane/navigation.cpp

@ -165,10 +165,10 @@ void Plane::calc_airspeed_errors() @@ -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;
}

3
ArduPlane/reverse_thrust.cpp

@ -143,7 +143,8 @@ float Plane::get_throttle_input(bool no_deadzone) const @@ -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());

Loading…
Cancel
Save