MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_ringbuffer_status

Function rt_ringbuffer_status

components/drivers/ipc/ringbuffer.c:18–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16#include <string.h>
17
18rt_inline enum rt_ringbuffer_state rt_ringbuffer_status(struct rt_ringbuffer *rb)
19{
20 if (rb->read_index == rb->write_index)
21 {
22 if (rb->read_mirror == rb->write_mirror)
23 return RT_RINGBUFFER_EMPTY;
24 else
25 return RT_RINGBUFFER_FULL;
26 }
27 return RT_RINGBUFFER_HALFFULL;
28}
29
30/**
31 * @brief Initialize the ring buffer object.

Callers 2

rt_ringbuffer_data_lenFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected