Skip to content

Commit

Permalink
AP_Mission: address minor review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
andyp1per authored and peterbarker committed Jul 23, 2024
1 parent d845af9 commit 5507596
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion libraries/AP_Mission/AP_Mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,6 @@ MAV_MISSION_RESULT AP_Mission::mavlink_int_to_mission_cmd(const mavlink_mission_

case MAV_CMD_DO_FENCE_ENABLE: // MAV ID: 207
cmd.p1 = packet.param1; // action 0=disable, 1=enable, 2=disable floor
// packet.param2; // bitmask see FENCE_TYPE enum
break;

case MAV_CMD_DO_AUX_FUNCTION:
Expand Down
6 changes: 3 additions & 3 deletions libraries/AP_Mission/AP_Mission_Commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,15 @@ bool AP_Mission::start_command_fence(const AP_Mission::Mission_Command& cmd)
return false;
}

if (cmd.p1 == 0) { // disable fence
if (cmd.p1 == uint8_t(AC_Fence::MavlinkFenceActions::DISABLE_FENCE)) { // disable fence
uint8_t fences = fence->enable_configured(false);
fence->print_fence_message("disabled", fences);
return true;
} else if (cmd.p1 == 1) { // enable fence
} else if (cmd.p1 == uint8_t(AC_Fence::MavlinkFenceActions::ENABLE_FENCE)) { // enable fence
uint8_t fences = fence->enable_configured(true);
fence->print_fence_message("enabled", fences);
return true;
} else if (cmd.p1 == 2) { // disable fence floor only
} else if (cmd.p1 == uint8_t(AC_Fence::MavlinkFenceActions::DISABLE_ALT_MIN_FENCE)) { // disable fence floor only
fence->disable_floor();
fence->print_fence_message("disabled", AC_FENCE_TYPE_ALT_MIN);
return true;
Expand Down

0 comments on commit 5507596

Please sign in to comment.