Skip to content

Commit

Permalink
commander: make sure all code paths return an (n)ack to MAV_CMD_PREFL…
Browse files Browse the repository at this point in the history
…IGHT_CALIBRATION
  • Loading branch information
bkueng committed Jan 11, 2017
1 parent 8cd913c commit dd94b26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modules/commander/commander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4024,14 +4024,15 @@ void *commander_low_prio_loop(void *arg)
} else if ((int)(cmd.param4) == 0) {
/* RC calibration ended - have we been in one worth confirming? */
if (status_flags.rc_input_blocked) {
answer_command(cmd, vehicle_command_s::VEHICLE_CMD_RESULT_ACCEPTED, command_ack_pub, command_ack);
/* enable RC control input */
status_flags.rc_input_blocked = false;
mavlink_log_info(&mavlink_log_pub, "CAL: Re-enabling RC IN");
calib_ret = OK;
}
answer_command(cmd, vehicle_command_s::VEHICLE_CMD_RESULT_ACCEPTED, command_ack_pub, command_ack);
/* this always succeeds */
calib_ret = OK;
} else {
answer_command(cmd, vehicle_command_s::VEHICLE_CMD_RESULT_UNSUPPORTED, command_ack_pub, command_ack);
}

status_flags.condition_calibration_enabled = false;
Expand Down

0 comments on commit dd94b26

Please sign in to comment.