summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2020-04-10 11:14:33 +0800
committerGitHub <[email protected]>2020-04-10 11:14:33 +0800
commit08ef2363085dc9c3964ccb331ed69f785ef86802 (patch)
tree4faffe0aacf32f9446c1047ffff99b8289dd5440 /components
parent5599bc73fa66c86643572175f270c91eb5d24893 (diff)
parentebfba4974cbdc95c3bc611cfc43930c762799240 (diff)
Merge pull request #3513 from jch12138/master
为FINSH添加clear命令
Diffstat (limited to 'components')
-rw-r--r--components/finsh/cmd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/components/finsh/cmd.c b/components/finsh/cmd.c
index 48a629961b..9743bfd18b 100644
--- a/components/finsh/cmd.c
+++ b/components/finsh/cmd.c
@@ -29,6 +29,7 @@
* 2018-11-22 Jesven list_thread add smp support
* 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_*
+ * 2020-04-07 chenhui add clear
*/
#include <rthw.h>
@@ -48,6 +49,15 @@ long hello(void)
}
FINSH_FUNCTION_EXPORT(hello, say hello world);
+long clear(void)
+{
+ rt_kprintf("\x1b[2J\x1b[H");
+
+ return 0;
+}
+FINSH_FUNCTION_EXPORT(clear,clear the terminal screen);
+MSH_CMD_EXPORT(clear,clear the terminal screen);
+
extern void rt_show_version(void);
long version(void)
{