From fb7715a3c5397d1e7a6f2c3b8adaf37227e6c1fe Mon Sep 17 00:00:00 2001 From: mculover666 <2412828003@qq.com> Date: Tue, 20 Jul 2021 13:02:47 +0800 Subject: [PATCH] fix bug in tos_at_channel_read_timed, update to 2.4.3 --- kernel/core/include/tos_version.h | 4 ++-- net/at/src/tos_at.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/core/include/tos_version.h b/kernel/core/include/tos_version.h index 88b60a4f..a8ea95cf 100644 --- a/kernel/core/include/tos_version.h +++ b/kernel/core/include/tos_version.h @@ -25,8 +25,8 @@ #define TOS_VERSION_MAJOR 0x02 #define TOS_VERSION_MINOR 0x04 -#define TOS_VERSION_PATCH 0x02 -#define TOS_VERSION "2.4.2" +#define TOS_VERSION_PATCH 0x03 +#define TOS_VERSION "2.4.3" #endif /* _TOS_VERSION_H_ */ diff --git a/net/at/src/tos_at.c b/net/at/src/tos_at.c index beb4411b..de0aeecd 100644 --- a/net/at/src/tos_at.c +++ b/net/at/src/tos_at.c @@ -709,11 +709,12 @@ __API__ int tos_at_channel_read_timed(int channel_id, uint8_t *buffer, size_t bu return total_read_len; } - read_len = tos_chr_fifo_pop_stream(&data_channel->rx_fifo, buffer + read_len, buffer_len - total_read_len); + read_len = tos_chr_fifo_pop_stream(&data_channel->rx_fifo, buffer + total_read_len, buffer_len - total_read_len); tos_mutex_post(&data_channel->rx_lock); if (read_len == 0) { + remain_tick = tos_stopwatch_remain(&data_channel->timer); tos_sem_pend(&data_channel->rx_sem, remain_tick); }