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:
parent
e7c5608f4a
commit
157e75c7ab
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
****************************************************************************/
|
||||
|
|
Loading…
Reference in a new issue