From 157e75c7ab0b2d16c13b8a3ccea0cb3a4c35d939 Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 16 Dec 2024 16:41:49 +0800 Subject: [PATCH] lib/circbuf: add static initialize macro helper struct circbuf_s circ = CIRCBUF_INITIALIZER(buffer, size); Signed-off-by: chao an --- include/nuttx/circbuf.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/nuttx/circbuf.h b/include/nuttx/circbuf.h index 3295c175cf..0b2ba990ce 100644 --- a/include/nuttx/circbuf.h +++ b/include/nuttx/circbuf.h @@ -37,6 +37,12 @@ #include #include +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define CIRCBUF_INITIALIZER(base, size) { base, size, 0, 0, true } + /**************************************************************************** * Public Types ****************************************************************************/