summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorliuchao <[email protected]>2024-11-04 17:59:59 +0800
committerMeco Man <[email protected]>2024-11-04 22:02:59 -0500
commitbdf5a1fb092fe3749a48098e06ae7e01815ec36f (patch)
treea6e9a99b2bfb39950c2245345e538272dd7c1a25 /components
parent96165a5e99c533b660b42be115f83b696361017a (diff)
[components][finsh]在RT_USING_POSIX_STDIO时,使用get_console获取当前console描述符
Diffstat (limited to 'components')
-rw-r--r--components/finsh/shell.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/components/finsh/shell.c b/components/finsh/shell.c
index e698edd51f..a9aa830ecd 100644
--- a/components/finsh/shell.c
+++ b/components/finsh/shell.c
@@ -32,6 +32,11 @@
#include <fcntl.h>
#endif /* DFS_USING_POSIX */
+#ifdef RT_USING_POSIX_STDIO
+#include <unistd.h>
+#include <posix/stdio.h>
+#endif /* RT_USING_POSIX_STDIO */
+
/* finsh thread */
#ifndef RT_USING_HEAP
static struct rt_thread finsh_thread;
@@ -154,7 +159,7 @@ int finsh_getchar(void)
#ifdef RT_USING_DEVICE
char ch = 0;
#ifdef RT_USING_POSIX_STDIO
- if(read(STDIN_FILENO, &ch, 1) > 0)
+ if(read(rt_posix_stdio_get_console(), &ch, 1) > 0)
{
return ch;
}