/* Change Logs: Date Author Notes  Bernard first version.  Grissiom reimplement  */
void rt_ringbuffer_init(struct rt_ringbuffer *rb, rt_uint8_t *pool, rt_int16_t size)
/* Change Logs: Date Author Notes  Bernard first version.  Grissiom reimplement  */
void rt_ringbuffer_init(struct rt_ringbuffer *rb, rt_uint8_t *pool, rt_int16_t size)
{
    RT_ASSERT(rb != RT_NULL);
    RT_ASSERT(size > 0)
    rb->read_mirror = rb->read_index = 0;
    rb->write_mirror = rb->write_index = 0;
    rb->buffer_ptr = pool;
    rb->buffer_size = RT_ALIGN_DOWN(size, RT_ALIGN_SIZE);
}