AP_Mission: correct compilation when RC_Channel not enabled

This commit is contained in:
Peter Barker 2023-12-09 17:09:26 +11:00 committed by Peter Barker
parent 22c1019767
commit f6bff8c19e
2 changed files with 5 additions and 0 deletions

View File

@ -10,6 +10,7 @@
#include <AP_Vehicle/AP_Vehicle_Type.h> #include <AP_Vehicle/AP_Vehicle_Type.h>
#include <AP_BoardConfig/AP_BoardConfig.h> #include <AP_BoardConfig/AP_BoardConfig.h>
#include <AP_ServoRelayEvents/AP_ServoRelayEvents_config.h> #include <AP_ServoRelayEvents/AP_ServoRelayEvents_config.h>
#include <RC_Channel/RC_Channel_config.h>
const AP_Param::GroupInfo AP_Mission::var_info[] = { const AP_Param::GroupInfo AP_Mission::var_info[] = {
@ -405,8 +406,10 @@ bool AP_Mission::start_command(const Mission_Command& cmd)
} }
switch (cmd.id) { switch (cmd.id) {
#if AP_RC_CHANNEL_ENABLED
case MAV_CMD_DO_AUX_FUNCTION: case MAV_CMD_DO_AUX_FUNCTION:
return start_command_do_aux_function(cmd); return start_command_do_aux_function(cmd);
#endif
#if AP_GRIPPER_ENABLED #if AP_GRIPPER_ENABLED
case MAV_CMD_DO_GRIPPER: case MAV_CMD_DO_GRIPPER:
return start_command_do_gripper(cmd); return start_command_do_gripper(cmd);

View File

@ -10,6 +10,7 @@
#include <RC_Channel/RC_Channel.h> #include <RC_Channel/RC_Channel.h>
#include <AP_Mount/AP_Mount.h> #include <AP_Mount/AP_Mount.h>
#if AP_RC_CHANNEL_ENABLED
bool AP_Mission::start_command_do_aux_function(const AP_Mission::Mission_Command& cmd) bool AP_Mission::start_command_do_aux_function(const AP_Mission::Mission_Command& cmd)
{ {
const RC_Channel::AUX_FUNC function = (RC_Channel::AUX_FUNC)cmd.content.auxfunction.function; const RC_Channel::AUX_FUNC function = (RC_Channel::AUX_FUNC)cmd.content.auxfunction.function;
@ -28,6 +29,7 @@ bool AP_Mission::start_command_do_aux_function(const AP_Mission::Mission_Command
rc().run_aux_function(function, pos, RC_Channel::AuxFuncTriggerSource::MISSION); rc().run_aux_function(function, pos, RC_Channel::AuxFuncTriggerSource::MISSION);
return true; return true;
} }
#endif // AP_RC_CHANNEL_ENABLED
#if AP_GRIPPER_ENABLED #if AP_GRIPPER_ENABLED
bool AP_Mission::start_command_do_gripper(const AP_Mission::Mission_Command& cmd) bool AP_Mission::start_command_do_gripper(const AP_Mission::Mission_Command& cmd)