From 0ef8c662a0beafedbf4bc7a85067395a3b569598 Mon Sep 17 00:00:00 2001 From: batt Date: Wed, 9 Apr 2008 16:25:13 +0000 Subject: [PATCH] fifo_len():new method. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1231 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/mware/fifobuf.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bertos/mware/fifobuf.h b/bertos/mware/fifobuf.h index cb634ee3..7fb06b63 100644 --- a/bertos/mware/fifobuf.h +++ b/bertos/mware/fifobuf.h @@ -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 -- 2.25.1