[drivers]Fix put_force bug
This commit is contained in:
parent
228c820e4d
commit
5b31545970
|
@ -119,8 +119,11 @@ rt_size_t rt_ringbuffer_put_force(struct rt_ringbuffer *rb,
|
||||||
|
|
||||||
space_length = rt_ringbuffer_space_len(rb);
|
space_length = rt_ringbuffer_space_len(rb);
|
||||||
|
|
||||||
if (length > space_length)
|
if (length > rb->buffer_size)
|
||||||
|
{
|
||||||
|
ptr = &ptr[length - rb->buffer_size];
|
||||||
length = rb->buffer_size;
|
length = rb->buffer_size;
|
||||||
|
}
|
||||||
|
|
||||||
if (rb->buffer_size - rb->write_index > length)
|
if (rb->buffer_size - rb->write_index > length)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue