lib/circbuf: add static initialize macro helper

struct circbuf_s circ = CIRCBUF_INITIALIZER(buffer, size);

Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
chao an 2024-12-16 16:41:49 +08:00 committed by Xiang Xiao
parent e7c5608f4a
commit 157e75c7ab

View file

@ -37,6 +37,12 @@
#include <stdbool.h>
#include <sys/types.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define CIRCBUF_INITIALIZER(base, size) { base, size, 0, 0, true }
/****************************************************************************
* Public Types
****************************************************************************/