mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-03 04:03:59 -04:00
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:
parent
37af7e5166
commit
13fa1e30ad
@ -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;
|
||||
}
|
||||
|
@ -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…
Reference in New Issue
Block a user