Merge pull request #1699 from qgyhd1234/at

[net][at] fix server repeated enter issue
This commit is contained in:
朱天龙 (Armink) 2018-08-05 08:30:57 +08:00 committed by GitHub
commit 03bf99a56d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -352,10 +352,10 @@ static char at_server_gerchar(void)
{
char ch;
if (rt_device_read(at_server_local->device, 0, &ch, 1) == 0)
while (rt_device_read(at_server_local->device, 0, &ch, 1) == 0)
{
rt_sem_control(at_server_local->rx_notice, RT_IPC_CMD_RESET, RT_NULL);
rt_sem_take(at_server_local->rx_notice, RT_WAITING_FOREVER);
rt_device_read(at_server_local->device, 0, &ch, 1);
}
return ch;