Add all missing functions.
[bertos.git] / mware / fifobuf.h
index a9b1d6bbf05ba7eff2b9a0d84e1df772185d998a..7edfa7bd5ae8e7e23bf4fcb59d32249c7ffde66e 100755 (executable)
 
 /*#*
  *#* $Log$
+ *#* Revision 1.20  2005/04/11 19:10:28  bernie
+ *#* Include top-level headers from cfg/ subdir.
+ *#*
+ *#* Revision 1.19  2004/12/08 08:30:12  bernie
+ *#* Add missing header.
+ *#*
+ *#* 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.
+ *#*
  *#* Revision 1.16  2004/09/06 21:39:08  bernie
  *#* Simplify code using ATOMIC().
  *#*
@@ -87,8 +99,8 @@
 #ifndef MWARE_FIFO_H
 #define MWARE_FIFO_H
 
-#include <cpu.h>
-#include <drv/kdebug.h>
+#include <cfg/cpu.h>
+#include <cfg/debug.h>
 
 typedef struct FIFOBuffer
 {
@@ -301,6 +313,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;
 }