fifo_len():new method.
[bertos.git] / bertos / mware / fifobuf.h
index cb634ee32ffe14e004c97a6645260380d333ba81..7fb06b63fc25f718cb7d3f62a61d2389f60f53d1 100644 (file)
@@ -291,6 +291,14 @@ INLINE void fifo_init(FIFOBuffer *fb, unsigned char *buf, size_t size)
        fb->end = buf + size - 1;
 }
 
+/**
+ * \return Lenght of the FIFOBuffer \a fb.
+ */
+INLINE size_t fifo_len(FIFOBuffer *fb)
+{
+       return fb->end - fb->begin;
+}
+
 
 #if 0