Introduce a macro to declare a static and correctly initialized
FIFOBuffer.
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5234
38d2e660-2303-0410-9eaa-
f027e97ec537
+/**
+ * Declare a static fifo buffer
+ */
+#define DECLARE_FIFO(_name, _ptr, _size) \
+ FIFOBuffer _name = \
+ { \
+ .head = (_ptr), \
+ .tail = (_ptr), \
+ .begin = (_ptr), \
+ .end = (_ptr) + (_size) - 1, \
+ }; \
+ STATIC_ASSERT((_size) > 1)
+
/**
* Check whether the fifo is empty
*
/**
* Check whether the fifo is empty
*