From: bernie Date: Tue, 16 Nov 2004 21:55:12 +0000 (+0000) Subject: Workaround for a known fifobuf bug. X-Git-Tag: 1.0.0~962 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=80c2a63229dadaf172ae1935e0ab24d402ea5f97;p=bertos.git Workaround for a known fifobuf bug. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@279 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/mware/fifobuf.h b/mware/fifobuf.h index 3bc2b5d0..d63b08cf 100755 --- a/mware/fifobuf.h +++ b/mware/fifobuf.h @@ -43,6 +43,9 @@ /*#* *#* $Log$ + *#* Revision 1.18 2004/11/16 21:55:12 bernie + *#* Workaround for a known fifobuf bug. + *#* *#* Revision 1.17 2004/09/14 20:57:00 bernie *#* Use debug.h instead of kdebug.h. *#* @@ -303,6 +306,9 @@ INLINE bool fifo_isfull_locked(const FIFOBuffer *_fb) */ INLINE void fifo_init(FIFOBuffer *fb, unsigned char *buf, size_t size) { + /* FIFO buffers have a known bug with 1-byte buffers. */ + ASSERT(size > 1); + fb->head = fb->tail = fb->begin = buf; fb->end = buf + size - 1; }