Use appconfig.h instead of cfg/config.h.
[bertos.git] / mware / fifobuf.h
index 3bc2b5d02310063c3d20c51286cc5f42884882a0..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.
  *#*
@@ -90,7 +99,8 @@
 #ifndef MWARE_FIFO_H
 #define MWARE_FIFO_H
 
-#include <cpu.h>
+#include <cfg/cpu.h>
+#include <cfg/debug.h>
 
 typedef struct FIFOBuffer
 {
@@ -303,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;
 }