We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75a7cb6 commit aa80ba2Copy full SHA for aa80ba2
components/finsh/shell.c
@@ -168,8 +168,17 @@ int finsh_getchar(void)
168
}
169
170
while (rt_device_read(device, -1, &ch, 1) != 1)
171
+ {
172
rt_sem_take(&shell->rx_sem, RT_WAITING_FOREVER);
-
173
+ if (shell->device != device)
174
175
+ device = shell->device;
176
+ if (device == RT_NULL)
177
178
+ return -1;
179
+ }
180
181
182
return ch;
183
#endif /* RT_USING_POSIX_STDIO */
184
#else
0 commit comments