From b1897cd9a419855008cc7ac7696f3e13cc10e14a Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 21 Sep 2022 23:13:20 +1000 Subject: [PATCH] AP_Filesystem: correct compilation with rally disabled --- libraries/AP_Filesystem/AP_Filesystem_Mission.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libraries/AP_Filesystem/AP_Filesystem_Mission.cpp b/libraries/AP_Filesystem/AP_Filesystem_Mission.cpp index 85d70e172f..59103f3f8a 100644 --- a/libraries/AP_Filesystem/AP_Filesystem_Mission.cpp +++ b/libraries/AP_Filesystem/AP_Filesystem_Mission.cpp @@ -221,10 +221,12 @@ bool AP_Filesystem_Mission::check_file_name(const char *name, enum MAV_MISSION_T return true; } #endif +#if HAL_RALLY_ENABLED if (strcmp(name, "rally.dat") == 0) { mtype = MAV_MISSION_TYPE_RALLY; return true; } +#endif return false; } @@ -245,10 +247,10 @@ bool AP_Filesystem_Mission::get_item(uint32_t idx, enum MAV_MISSION_TYPE mtype, case MAV_MISSION_TYPE_FENCE: return MissionItemProtocol_Fence::get_item_as_mission_item(idx, item); #endif - +#if HAL_RALLY_ENABLED case MAV_MISSION_TYPE_RALLY: return MissionItemProtocol_Rally::get_item_as_mission_item(idx, item); - +#endif default: break; } @@ -279,6 +281,7 @@ uint32_t AP_Filesystem_Mission::get_num_items(enum MAV_MISSION_TYPE mtype) const #endif } +#if HAL_RALLY_ENABLED case MAV_MISSION_TYPE_RALLY: { auto *rally = AP::rally(); if (rally == nullptr) { @@ -286,7 +289,8 @@ uint32_t AP_Filesystem_Mission::get_num_items(enum MAV_MISSION_TYPE mtype) const } return rally->get_rally_total(); } - +#endif + default: break; }