mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-26 09:08:25 +00:00
[console] 解决在没有定义RT_USING_DEVICE的情况下使用device报错的问题
* [console] 解决在没有定义RT_USING_DEVICE的情况下使用device报错的问题 * format codes * [libc] 整理格式 * refresh projects
This commit is contained in:
committed by
Bernard Xiong
parent
353f717037
commit
bb1084556f
@@ -6,6 +6,7 @@
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user