mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 03:58:33 +08:00
improve ringbuffer
This commit is contained in:
parent
24a1976eb4
commit
f479ff3dd1
@ -1,5 +1,8 @@
|
||||
# 最新动态
|
||||
|
||||
* 2020/09/04
|
||||
* 完善ringbuffer(感谢网友J,提供补丁)
|
||||
|
||||
* 2020/09/03
|
||||
* 完善toast(感谢智明提供补丁)。
|
||||
* 完善calibration win(感谢俊杰提供补丁)。
|
||||
|
@ -233,6 +233,7 @@ ret_t ring_buffer_read_len(ring_buffer_t* ring_buffer, void* buff, uint32_t size
|
||||
return_value_if_fail(ring_buffer != NULL && buff != NULL, RET_BAD_PARAMS);
|
||||
|
||||
if (ring_buffer_size(ring_buffer) >= size) {
|
||||
ring_buffer->full = FALSE;
|
||||
return ring_buffer_read(ring_buffer, buff, size) == size ? RET_OK : RET_FAIL;
|
||||
} else {
|
||||
return RET_FAIL;
|
||||
@ -243,6 +244,7 @@ ret_t ring_buffer_skip(ring_buffer_t* ring_buffer, uint32_t size) {
|
||||
return_value_if_fail(ring_buffer != NULL, RET_BAD_PARAMS);
|
||||
|
||||
if (ring_buffer_size(ring_buffer) >= size) {
|
||||
ring_buffer->full = FALSE;
|
||||
ring_buffer->r = (ring_buffer->r + size) % ring_buffer->capacity;
|
||||
|
||||
return RET_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user