From f8e4d7facd073d3a32f41da09555b66867e8e323 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 7 Nov 2021 19:30:18 +1100 Subject: [PATCH] GCS_MAVLink: support formatting of SD card --- libraries/GCS_MAVLink/GCS_Common.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index ae41dbaa2e..533501b1f4 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -4654,6 +4654,14 @@ MAV_RESULT GCS_MAVLINK::handle_command_int_packet(const mavlink_command_int_t &p return handle_command_do_set_roi_sysid(packet); case MAV_CMD_DO_SET_HOME: return handle_command_int_do_set_home(packet); + case MAV_CMD_STORAGE_FORMAT: { + if (!is_equal(packet.param1, 1.0f) || + !is_equal(packet.param2, 1.0f)) { + return MAV_RESULT_UNSUPPORTED; + } + return AP::FS().format() ? MAV_RESULT_ACCEPTED : MAV_RESULT_FAILED; + } + #if AP_SCRIPTING_ENABLED case MAV_CMD_SCRIPTING: {