mirror of
https://gitee.com/moluo-tech/AT-Command
synced 2025-06-17 07:57:52 +00:00
解决URC接收超时时打印无效的问题。
This commit is contained in:
parent
321be4256f
commit
f1a4fb8320
7
at.c
7
at.c
@ -277,13 +277,14 @@ static void urc_recv_process(at_obj_t *at, const char *buf, unsigned int size)
|
||||
//接收超时处理,默认MAX_URC_RECV_TIMEOUT
|
||||
if (at->urc_cnt > 0 && at_istimeout(at->urc_timer, MAX_URC_RECV_TIMEOUT)) {
|
||||
urc_buf[at->urc_cnt] = '\0';
|
||||
at->urc_cnt = 0;
|
||||
at->urc_item = NULL;
|
||||
if (at->urc_cnt > 2)
|
||||
at->adap.debug("urc recv timeout=>%s\r\n", urc_buf);
|
||||
at->urc_cnt = 0;
|
||||
at->urc_item = NULL;
|
||||
}
|
||||
|
||||
while (size--) {
|
||||
at->urc_timer = at_get_ms();
|
||||
at->urc_timer = at_get_ms();
|
||||
ch = *buf++;
|
||||
urc_buf[at->urc_cnt++] = ch;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user