Skip to content

Commit

Permalink
Copter: add DISALLOW_GCS_MODE_CHANGE_DURING_RC_FAILSAFE option
Browse files Browse the repository at this point in the history
  • Loading branch information
jschall authored and rmackay9 committed Jan 12, 2016
1 parent 5cc969f commit cc1f27a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ArduCopter/GCS_Mavlink.cpp
Expand Up @@ -1008,7 +1008,16 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)

case MAVLINK_MSG_ID_SET_MODE: // MAV ID: 11
{
#ifdef DISALLOW_GCS_MODE_CHANGE_DURING_RC_FAILSAFE
if (!copter.failsafe.radio) {
handle_set_mode(msg, FUNCTOR_BIND(&copter, &Copter::set_mode, bool, uint8_t));
} else {
// don't allow mode changes while in radio failsafe
mavlink_msg_command_ack_send_buf(msg, chan, MAVLINK_MSG_ID_SET_MODE, MAV_RESULT_FAILED);
}
#else
handle_set_mode(msg, FUNCTOR_BIND(&copter, &Copter::set_mode, bool, uint8_t));
#endif
break;
}

Expand Down

0 comments on commit cc1f27a

Please sign in to comment.