diff options
| author | Wayne Lin <[email protected]> | 2021-03-02 10:42:40 +0800 |
|---|---|---|
| committer | Wayne Lin <[email protected]> | 2021-03-02 10:42:40 +0800 |
| commit | eaacc0ae3e90eb381cad6e42183902f466eecdad (patch) | |
| tree | 03e1be548aecdbc043e9065e54cb6d6ed27b3890 /components | |
| parent | a50d81827a1a4d7172e761dd64cecc5553f349d9 (diff) | |
Optimize getc flow.
Diffstat (limited to 'components')
| -rw-r--r-- | components/net/at/src/at_client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/net/at/src/at_client.c b/components/net/at/src/at_client.c index 788549392d..f46abd5cd4 100644 --- a/components/net/at/src/at_client.c +++ b/components/net/at/src/at_client.c @@ -436,13 +436,13 @@ static rt_err_t at_client_getchar(at_client_t client, char *ch, rt_int32_t timeo while (rt_device_read(client->device, 0, ch, 1) == 0) { - rt_sem_control(client->rx_notice, RT_IPC_CMD_RESET, RT_NULL); - result = rt_sem_take(client->rx_notice, rt_tick_from_millisecond(timeout)); if (result != RT_EOK) { return result; } + + rt_sem_control(client->rx_notice, RT_IPC_CMD_RESET, RT_NULL); } return RT_EOK; |
