GCS_MAVLink: correct detection of feature AP_FILESYSTEM_FORMAT_ENABLED

This commit is contained in:
Peter Barker 2023-06-07 12:38:55 +10:00 committed by Peter Barker
parent 294b975335
commit 312254f761

View File

@ -1359,6 +1359,7 @@ void GCS_MAVLINK_InProgress::check_tasks()
} }
break; break;
case Type::SD_FORMAT: case Type::SD_FORMAT:
#if AP_FILESYSTEM_FORMAT_ENABLED
switch (AP::FS().get_format_status()) { switch (AP::FS().get_format_status()) {
case AP_Filesystem_Backend::FormatStatus::NOT_STARTED: case AP_Filesystem_Backend::FormatStatus::NOT_STARTED:
// we shouldn't get here // we shouldn't get here
@ -1375,6 +1376,7 @@ void GCS_MAVLINK_InProgress::check_tasks()
task.conclude(MAV_RESULT_FAILED); task.conclude(MAV_RESULT_FAILED);
break; break;
} }
#endif
break; break;
} }
} }
@ -5085,6 +5087,7 @@ MAV_RESULT GCS_MAVLINK::handle_command_do_set_roi(const mavlink_command_long_t &
return handle_command_do_set_roi(roi_loc); return handle_command_do_set_roi(roi_loc);
} }
#if AP_FILESYSTEM_FORMAT_ENABLED
MAV_RESULT GCS_MAVLINK::handle_command_storage_format(const mavlink_command_int_t &packet, const mavlink_message_t &msg) MAV_RESULT GCS_MAVLINK::handle_command_storage_format(const mavlink_command_int_t &packet, const mavlink_message_t &msg)
{ {
if (!is_equal(packet.param1, 1.0f) || if (!is_equal(packet.param1, 1.0f) ||
@ -5101,6 +5104,7 @@ MAV_RESULT GCS_MAVLINK::handle_command_storage_format(const mavlink_command_int_
} }
return MAV_RESULT_IN_PROGRESS; return MAV_RESULT_IN_PROGRESS;
} }
#endif
MAV_RESULT GCS_MAVLINK::handle_command_int_packet(const mavlink_command_int_t &packet) MAV_RESULT GCS_MAVLINK::handle_command_int_packet(const mavlink_command_int_t &packet)
{ {
@ -5145,9 +5149,11 @@ void GCS_MAVLINK::handle_command_int(const mavlink_message_t &msg)
// special handling of messages that need the mavlink_message_t // special handling of messages that need the mavlink_message_t
switch (packet.command) { switch (packet.command) {
#if AP_FILESYSTEM_FORMAT_ENABLED
case MAV_CMD_STORAGE_FORMAT: case MAV_CMD_STORAGE_FORMAT:
result = handle_command_storage_format(packet, msg); result = handle_command_storage_format(packet, msg);
break; break;
#endif
default: default:
result = handle_command_int_packet(packet); result = handle_command_int_packet(packet);
break; break;