Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
AdRainty
rt-thread
提交
02a0da51
R
rt-thread
项目概览
AdRainty
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
02a0da51
编写于
7月 03, 2022
作者:
S
Stanley Lwin
提交者:
GitHub
7月 04, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
List command (#6134)
* initial commit for list cmd
上级
9623706e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
105 addition
and
1 deletion
+105
-1
components/finsh/cmd.c
components/finsh/cmd.c
+105
-1
未找到文件。
components/finsh/cmd.c
浏览文件 @
02a0da51
/*
/*
* Copyright (c) 2006-202
1
, RT-Thread Development Team
* Copyright (c) 2006-202
2
, RT-Thread Development Team
*
*
* SPDX-License-Identifier: Apache-2.0
* SPDX-License-Identifier: Apache-2.0
*
*
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
* 2018-12-27 Jesven Fix the problem that disable interrupt too long in list_thread
* 2018-12-27 Jesven Fix the problem that disable interrupt too long in list_thread
* Provide protection for the "first layer of objects" when list_*
* Provide protection for the "first layer of objects" when list_*
* 2020-04-07 chenhui add clear
* 2020-04-07 chenhui add clear
* 2022-07-02 Stanley Lwin add list command
*/
*/
#include <rthw.h>
#include <rthw.h>
...
@@ -887,4 +888,107 @@ long list_device(void)
...
@@ -887,4 +888,107 @@ long list_device(void)
MSH_CMD_EXPORT
(
list_device
,
list
device
in
system
);
MSH_CMD_EXPORT
(
list_device
,
list
device
in
system
);
#endif
#endif
int
cmd_list
(
int
argc
,
char
**
argv
)
{
if
(
argc
==
2
)
{
if
(
strcmp
(
argv
[
1
],
"thread"
)
==
0
)
{
list_thread
();
}
else
if
(
strcmp
(
argv
[
1
],
"timer"
)
==
0
)
{
list_timer
();
}
#ifdef RT_USING_SEMAPHORE
else
if
(
strcmp
(
argv
[
1
],
"sem"
)
==
0
)
{
list_sem
();
}
#endif
/* RT_USING_SEMAPHORE */
#ifdef RT_USING_EVENT
else
if
(
strcmp
(
argv
[
1
],
"event"
)
==
0
)
{
list_event
();
}
#endif
/* RT_USING_EVENT */
#ifdef RT_USING_MUTEX
else
if
(
strcmp
(
argv
[
1
],
"mutex"
)
==
0
)
{
list_mutex
();
}
#endif
/* RT_USING_MUTEX */
#ifdef RT_USING_MAILBOX
else
if
(
strcmp
(
argv
[
1
],
"mailbox"
)
==
0
)
{
list_mailbox
();
}
#endif
/* RT_USING_MAILBOX */
#ifdef RT_USING_MESSAGEQUEUE
else
if
(
strcmp
(
argv
[
1
],
"msgqueue"
)
==
0
)
{
list_msgqueue
();
}
#endif
/* RT_USING_MESSAGEQUEUE */
#ifdef RT_USING_MEMPOOL
else
if
(
strcmp
(
argv
[
1
],
"mempool"
)
==
0
)
{
list_mempool
();
}
#endif
/* RT_USING_MEMPOOL */
#ifdef RT_USING_DEVICE
else
if
(
strcmp
(
argv
[
1
],
"device"
)
==
0
)
{
list_device
();
}
#endif
/* RT_USING_DEVICE */
#ifdef RT_USING_DFS
else
if
(
strcmp
(
argv
[
1
],
"fd"
)
==
0
)
{
extern
int
list_fd
(
void
);
list_fd
();
}
#endif
/* RT_USING_DFS */
else
{
goto
_usage
;
}
return
0
;
}
_usage:
rt_kprintf
(
"Usage: list [options]
\n
"
);
rt_kprintf
(
"[options]:
\n
"
);
rt_kprintf
(
" thread - list threads
\n
"
);
rt_kprintf
(
" timer - list timers
\n
"
);
#ifdef RT_USING_SEMAPHORE
rt_kprintf
(
" sem - list semaphores
\n
"
);
#endif
/* RT_USING_SEMAPHORE */
#ifdef RT_USING_MUTEX
rt_kprintf
(
" mutex - list mutexs
\n
"
);
#endif
/* RT_USING_MUTEX */
#ifdef RT_USING_EVENT
rt_kprintf
(
" event - list events
\n
"
);
#endif
/* RT_USING_EVENT */
#ifdef RT_USING_MAILBOX
rt_kprintf
(
" mailbox - list mailboxs
\n
"
);
#endif
/* RT_USING_MAILBOX */
#ifdef RT_USING_MESSAGEQUEUE
rt_kprintf
(
" msgqueue - list message queues
\n
"
);
#endif
/* RT_USING_MESSAGEQUEUE */
#ifdef RT_USING_MEMPOOL
rt_kprintf
(
" mempool - list memory pools
\n
"
);
#endif
/* RT_USING_MEMPOOL */
#ifdef RT_USING_DEVICE
rt_kprintf
(
" device - list devices
\n
"
);
#endif
/* RT_USING_DEVICE */
#ifdef RT_USING_DFS
rt_kprintf
(
" fd - list file descriptors
\n
"
);
#endif
/* RT_USING_DFS */
return
0
;
}
MSH_CMD_EXPORT_ALIAS
(
cmd_list
,
list
,
list
objects
);
#endif
/* RT_USING_FINSH */
#endif
/* RT_USING_FINSH */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录