Browse Source

AP_Filesystem: add support for AP_Logger into AP_Periph

c415-sdk
Peter Barker 4 years ago committed by Andrew Tridgell
parent
commit
c11a6bbb47
  1. 5
      libraries/AP_Filesystem/AP_Filesystem.cpp
  2. 4
      libraries/AP_Filesystem/AP_Filesystem_Mission.cpp
  3. 2
      libraries/AP_Filesystem/AP_Filesystem_Sys.cpp

5
libraries/AP_Filesystem/AP_Filesystem.cpp

@ -43,8 +43,11 @@ static AP_Filesystem_Param fs_param; @@ -43,8 +43,11 @@ static AP_Filesystem_Param fs_param;
#include "AP_Filesystem_Sys.h"
static AP_Filesystem_Sys fs_sys;
#include <AP_Mission/AP_Mission.h>
#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[] = { @@ -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

4
libraries/AP_Filesystem/AP_Filesystem_Mission.cpp

@ -23,6 +23,8 @@ @@ -23,6 +23,8 @@
#include <GCS_MAVLink/MissionItemProtocol_Rally.h>
#include <GCS_MAVLink/MissionItemProtocol_Fence.h>
#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) @@ -397,3 +399,5 @@ bool AP_Filesystem_Mission::finish_upload(const rfile &r)
}
return true;
}
#endif

2
libraries/AP_Filesystem/AP_Filesystem_Sys.cpp

@ -90,9 +90,11 @@ int AP_Filesystem_Sys::open(const char *fname, int flags) @@ -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);
}

Loading…
Cancel
Save