[console] 解决在没有定义RT_USING_DEVICE的情况下使用device报错的问题

* [console] 解决在没有定义RT_USING_DEVICE的情况下使用device报错的问题

* format codes

* [libc] 整理格式

* refresh projects
This commit is contained in:
Man, Jianting (Meco)
2022-01-08 10:29:41 -05:00
committed by Bernard Xiong
parent 353f717037
commit bb1084556f
784 changed files with 62419 additions and 45674 deletions

View File

@@ -6,6 +6,7 @@
* Change Logs:
* Date Author Notes
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@@ -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)
{