diff options
| author | WBI\nxf44444 <[email protected]> | 2022-01-26 01:43:05 +0800 |
|---|---|---|
| committer | WBI\nxf44444 <[email protected]> | 2022-01-26 01:43:05 +0800 |
| commit | 8b0f50b7e211ee32ab08ba085ecd74588c3a3c63 (patch) | |
| tree | 75440be5ecd30cc1403a9387851c0530ed057981 /components/libc/compilers/common/stdlib.c | |
| parent | 3be35fecae513b07c35bd6f3992bf7824434bdd6 (diff) | |
| parent | 32a5668593c578b85560338c29d76f3a252c8dbc (diff) | |
Update i2c driver, add read ACK and BUS status check
Diffstat (limited to 'components/libc/compilers/common/stdlib.c')
| -rw-r--r-- | components/libc/compilers/common/stdlib.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/components/libc/compilers/common/stdlib.c b/components/libc/compilers/common/stdlib.c new file mode 100644 index 0000000000..6cc0b9fdac --- /dev/null +++ b/components/libc/compilers/common/stdlib.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-02-15 Meco Man first version + */ + +#include <rtthread.h> + +#define DBG_TAG "stdlib" +#define DBG_LVL DBG_INFO +#include <rtdbg.h> + +void __rt_libc_exit(int status) +{ + rt_thread_t self = rt_thread_self(); + + if (self != RT_NULL) + { + LOG_E("thread:%s exit:%d!", self->name, status); + rt_thread_control(self, RT_THREAD_CTRL_CLOSE, RT_NULL); + } +} + +#ifdef RT_USING_MSH +int system(const char *command) +{ + extern int msh_exec(char *cmd, rt_size_t length); + + int ret = -RT_ENOMEM; + char *cmd = rt_strdup(command); + + if (cmd) + { + ret = msh_exec(cmd, rt_strlen(cmd)); + rt_free(cmd); + } + + return ret; +} +RTM_EXPORT(system); +#endif |
