Skip to content

Commit

Permalink
ArduCopter: remove AUX_FUNC entries based on feature defines
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Aug 19, 2024
1 parent 55b4e75 commit c98e021
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions ArduCopter/RC_Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ void RC_Channel_Copter::init_aux_function(const AUX_FUNC ch_option, const AuxSwi
case AUX_FUNC::GUIDED:
case AUX_FUNC::LAND:
case AUX_FUNC::LOITER:
#if HAL_PARACHUTE_ENABLED
case AUX_FUNC::PARACHUTE_RELEASE:
#endif
case AUX_FUNC::POSHOLD:
case AUX_FUNC::RESETTOARMEDYAW:
case AUX_FUNC::RTL:
Expand All @@ -99,7 +101,9 @@ void RC_Channel_Copter::init_aux_function(const AUX_FUNC ch_option, const AuxSwi
case AUX_FUNC::USER_FUNC1:
case AUX_FUNC::USER_FUNC2:
case AUX_FUNC::USER_FUNC3:
#if AP_WINCH_ENABLED
case AUX_FUNC::WINCH_CONTROL:
#endif
case AUX_FUNC::ZIGZAG:
case AUX_FUNC::ZIGZAG_Auto:
case AUX_FUNC::ZIGZAG_SaveWP:
Expand All @@ -116,15 +120,21 @@ void RC_Channel_Copter::init_aux_function(const AUX_FUNC ch_option, const AuxSwi
case AUX_FUNC::ATTCON_FEEDFWD:
case AUX_FUNC::INVERTED:
case AUX_FUNC::MOTOR_INTERLOCK:
#if HAL_PARACHUTE_ENABLED
case AUX_FUNC::PARACHUTE_3POS: // we trust the vehicle will be disarmed so even if switch is in release position the chute will not release
case AUX_FUNC::PARACHUTE_ENABLE:
#endif
case AUX_FUNC::PRECISION_LOITER:
#if AP_RANGEFINDER_ENABLED
case AUX_FUNC::RANGEFINDER:
#endif
case AUX_FUNC::SIMPLE_MODE:
case AUX_FUNC::STANDBY:
case AUX_FUNC::SUPERSIMPLE_MODE:
case AUX_FUNC::SURFACE_TRACKING:
#if AP_WINCH_ENABLED
case AUX_FUNC::WINCH_ENABLE:
#endif
case AUX_FUNC::AIRMODE:
case AUX_FUNC::FORCEFLYING:
case AUX_FUNC::CUSTOM_CONTROLLER:
Expand Down Expand Up @@ -270,7 +280,7 @@ bool RC_Channel_Copter::do_aux_function(const AUX_FUNC ch_option, const AuxSwitc
copter.rangefinder_state.enabled = false;
}
break;
#endif
#endif // AP_RANGEFINDER_ENABLED

#if MODE_ACRO_ENABLED == ENABLED
case AUX_FUNC::ACRO_TRAINER:
Expand Down Expand Up @@ -343,7 +353,7 @@ bool RC_Channel_Copter::do_aux_function(const AUX_FUNC ch_option, const AuxSwitc
break;
}
break;
#endif
#endif // HAL_PARACHUTE_ENABLED

case AUX_FUNC::ATTCON_FEEDFWD:
// enable or disable feed forward
Expand Down Expand Up @@ -451,11 +461,11 @@ bool RC_Channel_Copter::do_aux_function(const AUX_FUNC ch_option, const AuxSwitc
break;
}
break;
#endif

case AUX_FUNC::WINCH_CONTROL:
// do nothing, used to control the rate of the winch and is processed within AP_Winch
break;
#endif // AP_WINCH_ENABLED

#ifdef USERHOOK_AUXSWITCH
case AUX_FUNC::USER_FUNC1:
Expand Down

0 comments on commit c98e021

Please sign in to comment.