mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-29 10:24:07 +08:00
print_load:Support NuttX Dynamic FDs
This commit is contained in:
parent
ec61512cdf
commit
4353d0faf3
@ -222,19 +222,16 @@ void print_load_buffer(char *buffer, int buffer_length, print_load_callback_f cb
|
||||
uint8_t tcb_sched_priority = system_load.tasks[i].tcb->sched_priority;
|
||||
|
||||
unsigned int tcb_num_used_fds = 0; // number of used file descriptors
|
||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||
FAR struct task_group_s *group = system_load.tasks[i].tcb->group;
|
||||
struct filelist *filelist = &system_load.tasks[i].tcb->group->tg_filelist;
|
||||
|
||||
if (group) {
|
||||
for (int fd_index = 0; fd_index < CONFIG_NFILE_DESCRIPTORS; ++fd_index) {
|
||||
if (group->tg_filelist.fl_files[fd_index].f_inode) {
|
||||
for (int fdr = 0; fdr < filelist->fl_rows; fdr++) {
|
||||
for (int fdc = 0; fdc < CONFIG_NFILE_DESCRIPTORS_PER_BLOCK; fdc++) {
|
||||
if (filelist->fl_files[fdr][fdc].f_inode) {
|
||||
++tcb_num_used_fds;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
sched_unlock();
|
||||
|
||||
switch (tcb_task_state) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user