From 3c0fbf0c7e131e722028d42235c88f3f34b3378a Mon Sep 17 00:00:00 2001 From: bernard Date: Tue, 17 Oct 2017 09:45:17 +0800 Subject: [PATCH] [finsh] Fix the C99 issue. --- components/finsh/shell.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/finsh/shell.c b/components/finsh/shell.c index 462d4643e5..8e1f814560 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -84,13 +84,12 @@ const char *finsh_get_prompt() static char finsh_getchar(void) { - RT_ASSERT(shell != RT_NULL); - #ifdef RT_USING_POSIX_STDIN return getchar(); #else char ch; + RT_ASSERT(shell != RT_NULL); while (rt_device_read(shell->device, -1, &ch, 1) != 1) rt_sem_take(&shell->rx_sem, RT_WAITING_FOREVER); -- GitLab