fix bug in tos_at_channel_read_timed, update to 2.4.3

This commit is contained in:
mculover666
2021-07-20 13:02:47 +08:00
parent 8e9024caca
commit fb7715a3c5
2 changed files with 4 additions and 3 deletions

View File

@@ -25,8 +25,8 @@
#define TOS_VERSION_MAJOR 0x02 #define TOS_VERSION_MAJOR 0x02
#define TOS_VERSION_MINOR 0x04 #define TOS_VERSION_MINOR 0x04
#define TOS_VERSION_PATCH 0x02 #define TOS_VERSION_PATCH 0x03
#define TOS_VERSION "2.4.2" #define TOS_VERSION "2.4.3"
#endif /* _TOS_VERSION_H_ */ #endif /* _TOS_VERSION_H_ */

View File

@@ -709,11 +709,12 @@ __API__ int tos_at_channel_read_timed(int channel_id, uint8_t *buffer, size_t bu
return total_read_len; 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); tos_mutex_post(&data_channel->rx_lock);
if (read_len == 0) { if (read_len == 0) {
remain_tick = tos_stopwatch_remain(&data_channel->timer);
tos_sem_pend(&data_channel->rx_sem, remain_tick); tos_sem_pend(&data_channel->rx_sem, remain_tick);
} }