GCS_MAVLink: allow removal of preflight commands to fail the autopilot

This commit is contained in:
Peter Barker 2023-06-21 17:25:06 +10:00 committed by Peter Barker
parent aefc2a8492
commit 6097f1aa61
2 changed files with 8 additions and 0 deletions

View File

@ -3100,6 +3100,7 @@ MAV_RESULT GCS_MAVLINK::handle_preflight_reboot(const mavlink_command_long_t &pa
if (is_equal(packet.param1, 42.0f) &&
is_equal(packet.param2, 24.0f) &&
is_equal(packet.param3, 71.0f)) {
#if AP_MAVLINK_FAILURE_CREATION_ENABLED
if (is_equal(packet.param4, 93.0f)) {
// this is a magic sequence to force the main loop to
// lockup. This is for testing the stm32 watchdog
@ -3153,6 +3154,8 @@ MAV_RESULT GCS_MAVLINK::handle_preflight_reboot(const mavlink_command_long_t &pa
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
return MAV_RESULT_ACCEPTED;
}
#endif // AP_MAVLINK_FAILURE_CREATION_ENABLED
#if HAL_ENABLE_DFU_BOOT
if (is_equal(packet.param4, 99.0f)) {
#if AP_SIGNED_FIRMWARE

View File

@ -44,3 +44,8 @@
#ifndef AP_MAVLINK_MSG_RELAY_STATUS_ENABLED
#define AP_MAVLINK_MSG_RELAY_STATUS_ENABLED HAL_GCS_ENABLED && AP_RELAY_ENABLED
#endif
// allow removal of developer-centric mavlink commands
#ifndef AP_MAVLINK_FAILURE_CREATION_ENABLED
#define AP_MAVLINK_FAILURE_CREATION_ENABLED 1
#endif