AP_Filesystem: add support for @SYS/dma.txt for DMA contention

This commit is contained in:
Andy Piper 2020-11-21 16:00:29 +00:00 committed by Andrew Tridgell
parent cf2602f91d
commit 32edb6d0cd

View File

@ -33,6 +33,7 @@ struct SysFileList {
static const SysFileList sysfs_file_list[] = {
{"threads.txt", 1024},
{"tasks.txt", 6500},
{"dma.txt", 1024},
#if HAL_MAX_CAN_PROTOCOL_DRIVERS
{"can_log.txt", 1024},
{"can0_stats.txt", 1024},
@ -98,6 +99,12 @@ int AP_Filesystem_Sys::open(const char *fname, int flags)
}
}
}
if (strcmp(fname, "dma.txt") == 0) {
r.data->data = (char *)malloc(max_size);
if (r.data->data) {
r.data->length = hal.util->dma_info(r.data->data, max_size);
}
}
#if HAL_MAX_CAN_PROTOCOL_DRIVERS
int8_t can_stats_num = -1;
if (strcmp(fname, "can_log.txt") == 0) {