Workaround for a known fifobuf bug.
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 16 Nov 2004 21:55:12 +0000 (21:55 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 16 Nov 2004 21:55:12 +0000 (21:55 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@279 38d2e660-2303-0410-9eaa-f027e97ec537

mware/fifobuf.h

index 3bc2b5d02310063c3d20c51286cc5f42884882a0..d63b08cf0ae5298294ff72532462c6aaa9477d58 100755 (executable)
@@ -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;
 }