summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
author朱天龙 (Armink) <[email protected]>2018-08-05 08:30:57 +0800
committerGitHub <[email protected]>2018-08-05 08:30:57 +0800
commit03bf99a56de255d41655bc8486d50cadbcae22f0 (patch)
tree46372dcd56691be5a091016009fad808ce3e5bcc /components
parent471a2aa6066a861a8cbccec1aba174a3ae0ec5a7 (diff)
parentf166ac946bb20d3d739e5d5e9817aa92010ea13f (diff)
Merge pull request #1699 from qgyhd1234/at
[net][at] fix server repeated enter issue
Diffstat (limited to 'components')
-rw-r--r--components/net/at/src/at_server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/net/at/src/at_server.c b/components/net/at/src/at_server.c
index a148a20ab0..ebb37489b0 100644
--- a/components/net/at/src/at_server.c
+++ b/components/net/at/src/at_server.c
@@ -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;