AP_Filesystem: add support for AP_Logger into AP_Periph

This commit is contained in:
Peter Barker 2021-05-20 12:34:12 +10:00 committed by Andrew Tridgell
parent 80a17cb97f
commit c11a6bbb47
3 changed files with 11 additions and 0 deletions

View File

@ -43,8 +43,11 @@ static AP_Filesystem_Param fs_param;
#include "AP_Filesystem_Sys.h" #include "AP_Filesystem_Sys.h"
static AP_Filesystem_Sys fs_sys; static AP_Filesystem_Sys fs_sys;
#include <AP_Mission/AP_Mission.h>
#if HAL_MISSION_ENABLED
#include "AP_Filesystem_Mission.h" #include "AP_Filesystem_Mission.h"
static AP_Filesystem_Mission fs_mission; static AP_Filesystem_Mission fs_mission;
#endif
/* /*
mapping from filesystem prefix to backend mapping from filesystem prefix to backend
@ -57,7 +60,9 @@ const AP_Filesystem::Backend AP_Filesystem::backends[] = {
{ "@PARAM/", fs_param }, { "@PARAM/", fs_param },
{ "@SYS/", fs_sys }, { "@SYS/", fs_sys },
{ "@SYS", fs_sys }, { "@SYS", fs_sys },
#if HAL_MISSION_ENABLED
{ "@MISSION/", fs_mission }, { "@MISSION/", fs_mission },
#endif
}; };
#define MAX_FD_PER_BACKEND 256U #define MAX_FD_PER_BACKEND 256U

View File

@ -23,6 +23,8 @@
#include <GCS_MAVLink/MissionItemProtocol_Rally.h> #include <GCS_MAVLink/MissionItemProtocol_Rally.h>
#include <GCS_MAVLink/MissionItemProtocol_Fence.h> #include <GCS_MAVLink/MissionItemProtocol_Fence.h>
#if HAL_MISSION_ENABLED
extern const AP_HAL::HAL& hal; extern const AP_HAL::HAL& hal;
extern int errno; extern int errno;
@ -397,3 +399,5 @@ bool AP_Filesystem_Mission::finish_upload(const rfile &r)
} }
return true; return true;
} }
#endif

View File

@ -90,9 +90,11 @@ int AP_Filesystem_Sys::open(const char *fname, int flags)
if (strcmp(fname, "threads.txt") == 0) { if (strcmp(fname, "threads.txt") == 0) {
hal.util->thread_info(*r.str); hal.util->thread_info(*r.str);
} }
#if HAL_SCHEDULER_ENABLED
if (strcmp(fname, "tasks.txt") == 0) { if (strcmp(fname, "tasks.txt") == 0) {
AP::scheduler().task_info(*r.str); AP::scheduler().task_info(*r.str);
} }
#endif
if (strcmp(fname, "dma.txt") == 0) { if (strcmp(fname, "dma.txt") == 0) {
hal.util->dma_info(*r.str); hal.util->dma_info(*r.str);
} }