From c11a6bbb47c116cbf1c462106a4c0723d5141229 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 20 May 2021 12:34:12 +1000 Subject: [PATCH] AP_Filesystem: add support for AP_Logger into AP_Periph --- libraries/AP_Filesystem/AP_Filesystem.cpp | 5 +++++ libraries/AP_Filesystem/AP_Filesystem_Mission.cpp | 4 ++++ libraries/AP_Filesystem/AP_Filesystem_Sys.cpp | 2 ++ 3 files changed, 11 insertions(+) diff --git a/libraries/AP_Filesystem/AP_Filesystem.cpp b/libraries/AP_Filesystem/AP_Filesystem.cpp index a3a8e8933b..dbc036e502 100644 --- a/libraries/AP_Filesystem/AP_Filesystem.cpp +++ b/libraries/AP_Filesystem/AP_Filesystem.cpp @@ -43,8 +43,11 @@ static AP_Filesystem_Param fs_param; #include "AP_Filesystem_Sys.h" static AP_Filesystem_Sys fs_sys; +#include +#if HAL_MISSION_ENABLED #include "AP_Filesystem_Mission.h" static AP_Filesystem_Mission fs_mission; +#endif /* mapping from filesystem prefix to backend @@ -57,7 +60,9 @@ const AP_Filesystem::Backend AP_Filesystem::backends[] = { { "@PARAM/", fs_param }, { "@SYS/", fs_sys }, { "@SYS", fs_sys }, +#if HAL_MISSION_ENABLED { "@MISSION/", fs_mission }, +#endif }; #define MAX_FD_PER_BACKEND 256U diff --git a/libraries/AP_Filesystem/AP_Filesystem_Mission.cpp b/libraries/AP_Filesystem/AP_Filesystem_Mission.cpp index f526dbecf1..d4cb9f34de 100644 --- a/libraries/AP_Filesystem/AP_Filesystem_Mission.cpp +++ b/libraries/AP_Filesystem/AP_Filesystem_Mission.cpp @@ -23,6 +23,8 @@ #include #include +#if HAL_MISSION_ENABLED + extern const AP_HAL::HAL& hal; extern int errno; @@ -397,3 +399,5 @@ bool AP_Filesystem_Mission::finish_upload(const rfile &r) } return true; } + +#endif diff --git a/libraries/AP_Filesystem/AP_Filesystem_Sys.cpp b/libraries/AP_Filesystem/AP_Filesystem_Sys.cpp index d25409e785..ebd7f03a02 100644 --- a/libraries/AP_Filesystem/AP_Filesystem_Sys.cpp +++ b/libraries/AP_Filesystem/AP_Filesystem_Sys.cpp @@ -90,9 +90,11 @@ int AP_Filesystem_Sys::open(const char *fname, int flags) if (strcmp(fname, "threads.txt") == 0) { hal.util->thread_info(*r.str); } +#if HAL_SCHEDULER_ENABLED if (strcmp(fname, "tasks.txt") == 0) { AP::scheduler().task_info(*r.str); } +#endif if (strcmp(fname, "dma.txt") == 0) { hal.util->dma_info(*r.str); }