summaryrefslogtreecommitdiff
path: root/components/libc/compilers/armlibc
diff options
context:
space:
mode:
authorMan, Jianting (Meco) <[email protected]>2022-01-08 10:29:41 -0500
committerBernard Xiong <[email protected]>2022-01-09 00:20:32 +0800
commitbb1084556ff9395e6e5d908edfef9cab6f6fa4dc (patch)
tree97e0844decee5d889c1b10d88d16db36bba44245 /components/libc/compilers/armlibc
parent353f717037b57f663ddce9447fd05700f3087a66 (diff)
[console] 解决在没有定义RT_USING_DEVICE的情况下使用device报错的问题
* [console] 解决在没有定义RT_USING_DEVICE的情况下使用device报错的问题 * format codes * [libc] 整理格式 * refresh projects
Diffstat (limited to 'components/libc/compilers/armlibc')
-rw-r--r--components/libc/compilers/armlibc/libc_syms.c1
-rw-r--r--components/libc/compilers/armlibc/syscalls.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/components/libc/compilers/armlibc/libc_syms.c b/components/libc/compilers/armlibc/libc_syms.c
index 829d57b559..2b370a25a6 100644
--- a/components/libc/compilers/armlibc/libc_syms.c
+++ b/components/libc/compilers/armlibc/libc_syms.c
@@ -6,6 +6,7 @@
* Change Logs:
* Date Author Notes
*/
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/components/libc/compilers/armlibc/syscalls.c b/components/libc/compilers/armlibc/syscalls.c
index f4ced9d3c0..82c0f38b4f 100644
--- a/components/libc/compilers/armlibc/syscalls.c
+++ b/components/libc/compilers/armlibc/syscalls.c
@@ -204,7 +204,7 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode)
if (fh == STDOUT || fh == STDERR)
{
-#ifdef RT_USING_CONSOLE
+#if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE)
rt_device_t console;
console = rt_console_get_device();
if (console)
@@ -214,7 +214,7 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode)
return 0; /* success */
#else
return 0; /* error */
-#endif /* RT_USING_CONSOLE */
+#endif /* defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE) */
}
else if (fh == STDIN)
{