Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions components/drivers/ipc/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
menuconfig RT_USING_DEVICE_IPC
bool "Using device drivers IPC"
default y
select RT_USING_MUTEX
select RT_USING_SEMAPHORE

if RT_USING_DEVICE_IPC
config RT_UNAMED_PIPE_NUMBER
Expand Down
1 change: 1 addition & 0 deletions components/finsh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ menuconfig RT_USING_MSH
bool "MSH: command shell"
default n if RT_USING_NANO
default y
select RT_USING_SEMAPHORE

if RT_USING_MSH

Expand Down
2 changes: 2 additions & 0 deletions components/finsh/finsh.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ typedef long (*syscall_func)(void);
};

#endif /* _MSC_VER */
#else
Copy link

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[documentation/文档]: Empty macro definition lacks explanatory comment.

English: The empty macro definition should include a comment explaining why it's empty and its purpose when FINSH_USING_SYMTAB is not defined. This helps maintainers understand the design decision.
中文:空宏定义缺少解释性注释。应该包含注释说明为什么在未定义 FINSH_USING_SYMTAB 时该宏为空,以及其设计目的。这有助于维护者理解设计决策。

Copilot uses AI. Check for mistakes.
#define MSH_FUNCTION_EXPORT_CMD(name, cmd, desc, opt)
#endif /* FINSH_USING_SYMTAB */

/**
Expand Down
19 changes: 10 additions & 9 deletions components/finsh/msh.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@ static int msh_help(int argc, char **argv)
rt_kprintf("RT-Thread shell commands:\n");
{
struct finsh_syscall *index;

#if defined(FINSH_USING_SYMTAB)
for (index = _syscall_table_begin;
index < _syscall_table_end;
FINSH_NEXT_SYSCALL(index))
{
#if defined(FINSH_USING_DESCRIPTION) && defined(FINSH_USING_SYMTAB)
#if defined(FINSH_USING_DESCRIPTION)
rt_kprintf("%-16s - %s\n", index->name, index->desc);
#else
rt_kprintf("%s ", index->name);
#endif
#endif /* FINSH_USING_DESCRIPTION */
}
#endif /* FINSH_USING_SYMTAB */
Comment on lines +40 to +51
Copy link

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[maintainability/可维护性]: The nested conditional compilation blocks create complex structure that could be simplified.

English: The nested #ifdef FINSH_USING_DESCRIPTION inside the #ifdef FINSH_USING_SYMTAB block increases complexity. Consider extracting the loop body into a separate inline function to improve readability and maintainability.
中文:嵌套的条件编译块增加了代码复杂度。在 #ifdef FINSH_USING_SYMTAB 内部再嵌套 #ifdef FINSH_USING_DESCRIPTION 使结构变得复杂。建议将循环体提取为独立的内联函数以提高可读性和可维护性。

Copilot generated this review using guidance from repository custom instructions.
}
rt_kprintf("\n");

Expand Down Expand Up @@ -231,7 +232,7 @@ static cmd_function_t msh_get_cmd(char *cmd, int size)
{
struct finsh_syscall *index;
cmd_function_t cmd_func = RT_NULL;

#if defined(FINSH_USING_SYMTAB)
for (index = _syscall_table_begin;
index < _syscall_table_end;
FINSH_NEXT_SYSCALL(index))
Expand All @@ -243,7 +244,7 @@ static cmd_function_t msh_get_cmd(char *cmd, int size)
break;
}
}

#endif /* FINSH_USING_SYMTAB */
return cmd_func;
}

Expand Down Expand Up @@ -814,7 +815,7 @@ void msh_auto_complete(char *prefix)
#endif /* RT_USING_MODULE */
}
#endif /* DFS_USING_POSIX */

#if defined(FINSH_USING_SYMTAB)
/* checks in internal command */
{
for (index = _syscall_table_begin; index < _syscall_table_end; FINSH_NEXT_SYSCALL(index))
Expand All @@ -839,7 +840,7 @@ void msh_auto_complete(char *prefix)
}
}
}

#endif /* FINSH_USING_SYMTAB */
/* auto complete string */
if (name_ptr != NULL)
{
Expand All @@ -866,7 +867,7 @@ static msh_cmd_opt_t *msh_get_cmd_opt(char *opt_str)
{
len = strlen(opt_str);
}

#if defined(FINSH_USING_SYMTAB)
for (index = _syscall_table_begin;
index < _syscall_table_end;
FINSH_NEXT_SYSCALL(index))
Expand All @@ -877,7 +878,7 @@ static msh_cmd_opt_t *msh_get_cmd_opt(char *opt_str)
break;
}
}

#endif /* FINSH_USING_SYMTAB */
return opt;
}

Expand Down