diff --git a/libraries/AP_Filesystem/AP_Filesystem_Sys.cpp b/libraries/AP_Filesystem/AP_Filesystem_Sys.cpp index 9fa2438481..3cbc3505a8 100644 --- a/libraries/AP_Filesystem/AP_Filesystem_Sys.cpp +++ b/libraries/AP_Filesystem/AP_Filesystem_Sys.cpp @@ -21,6 +21,7 @@ #include "AP_Filesystem_Sys.h" #include #include +#include extern const AP_HAL::HAL& hal; @@ -53,6 +54,17 @@ int AP_Filesystem_Sys::open(const char *fname, int flags) r.data->length = hal.util->thread_info(r.data->data, max_size); } } + if (strcmp(fname, "tasks.txt") == 0) { + const uint32_t max_size = 6144; + r.data->data = (char *)malloc(max_size); + if (r.data->data) { + r.data->length = AP::scheduler().task_info(r.data->data, max_size); + if (r.data->length == 0) { // the feature may be disabled + free(r.data->data); + r.data->data = nullptr; + } + } + } #if HAL_MAX_CAN_PROTOCOL_DRIVERS int8_t can_stats_num = -1; if (strcmp(fname, "can_log.txt") == 0) {