Skip to content

Commit 56aa0fe

Browse files
authored
Merge pull request #5106 from mysterywolf/system
[libc][keil][iar] 支持system函数
2 parents 4c1c946 + 54e30ed commit 56aa0fe

File tree

1 file changed

+9
-2
lines changed
  • components/libc/compilers/common

1 file changed

+9
-2
lines changed

components/libc/compilers/common/stdlib.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,26 @@
1010

1111
#include <rtthread.h>
1212

13+
#define DBG_TAG "stdlib"
14+
#define DBG_LVL DBG_INFO
15+
#include <rtdbg.h>
16+
1317
void __rt_libc_exit(int status)
1418
{
1519
rt_thread_t self = rt_thread_self();
1620

1721
if (self != RT_NULL)
1822
{
19-
rt_kprintf("thread:%s exit:%d!\n", self->name, status);
23+
LOG_E("thread:%s exit:%d!", self->name, status);
2024
rt_thread_control(self, RT_THREAD_CTRL_CLOSE, RT_NULL);
2125
}
2226
}
2327

2428
int __rt_libc_system(const char *string)
2529
{
26-
/* TODO */
30+
#ifdef RT_USING_MSH
31+
extern int msh_exec(char *cmd, rt_size_t length);
32+
msh_exec((char*)string, rt_strlen(string));
33+
#endif
2734
return 0;
2835
}

0 commit comments

Comments
 (0)