Skip to content

Commit

Permalink
Copter: don't take any action on Solo button press events if there is…
Browse files Browse the repository at this point in the history
… a radio failsafe
  • Loading branch information
jschall committed Nov 13, 2015
1 parent 64c9735 commit ad51c76
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ArduCopter/GCS_Mavlink.pde
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,11 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
case MAV_CMD_SOLO_BTN_FLY_CLICK: {
result = MAV_RESULT_ACCEPTED;

// don't do anything if there is a radio failsafe
if (failsafe.radio) {
break;
}

if (set_mode(LOITER)) {
send_heartbeat_immediately = true;
} else if (set_mode(ALT_HOLD)) {
Expand All @@ -1498,6 +1503,11 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
case MAV_CMD_SOLO_BTN_FLY_HOLD: {
result = MAV_RESULT_ACCEPTED;

// don't do anything if there is a radio failsafe
if (failsafe.radio) {
break;
}

if (!motors.armed()) {
init_arm_motors(true);
} else if (ap.land_complete) {
Expand All @@ -1516,6 +1526,11 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
case MAV_CMD_SOLO_BTN_PAUSE_CLICK: {
result = MAV_RESULT_ACCEPTED;

// don't do anything if there is a radio failsafe
if (failsafe.radio) {
break;
}

if (motors.armed()) {
if (ap.land_complete) {
// if landed, disarm motors
Expand Down

0 comments on commit ad51c76

Please sign in to comment.