From: batt Date: Wed, 9 Apr 2008 16:25:13 +0000 (+0000) Subject: fifo_len():new method. X-Git-Tag: 1.0.0~21 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=0ef8c662a0beafedbf4bc7a85067395a3b569598;p=bertos.git fifo_len():new method. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1231 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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