4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-30 02:51:33 +08:00

Merge pull request #1698 from qgyhd1234/at

[net][at] fix repeated enter issue
This commit is contained in:
朱天龙 (Armink) 2018-08-04 18:36:24 +08:00 committed by GitHub
commit 279661dd3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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