未验证 提交 aa80ba25 编写于 作者: L LiuKang 提交者: GitHub

[update] fix finsh bug (#5676)

* [update] fix finsh bug

* [update] format code
上级 75a7cb69
......@@ -168,8 +168,17 @@ int finsh_getchar(void)
}
while (rt_device_read(device, -1, &ch, 1) != 1)
{
rt_sem_take(&shell->rx_sem, RT_WAITING_FOREVER);
if (shell->device != device)
{
device = shell->device;
if (device == RT_NULL)
{
return -1;
}
}
}
return ch;
#endif /* RT_USING_POSIX_STDIO */
#else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册