SimAVR
AVR Simulator
FIFO helpers, aka circular buffers

these macros define accessories for FIFOs of any name, type and any (power of two) size More...

Macros

#define FIFO_CURSOR_TYPE   uint16_t
 
#define FIFO_BOOL_TYPE   int
 
#define FIFO_INLINE   inline
 
#define FIFO_VOLATILE
 
#define FIFO_SYNC   __sync_synchronize()
 
#define FIFO_ZERO_INIT   {0}
 
#define FIFO_NULL   { FIFO_ZERO_INIT, 0, 0, 0 }
 
#define FIFO_DECL   static
 
#define DECLARE_FIFO(__type, __name, __size)
 
#define DEFINE_FIFO(__type, __name)
 

Detailed Description

these macros define accessories for FIFOs of any name, type and any (power of two) size

Macro Definition Documentation

#define DECLARE_FIFO (   __type,
  __name,
  __size 
)
Value:
enum { __name##_overflow_f = (1 << 0) }; \
enum { __name##_fifo_size = (__size) }; \
typedef struct __name##_t { \
__type buffer[__name##_fifo_size]; \
FIFO_VOLATILE uint8_t flags; \
} __name##_t
#define FIFO_CURSOR_TYPE
Definition: fifo_declare.h:79
#define FIFO_VOLATILE
Definition: fifo_declare.h:90
#define DEFINE_FIFO (   __type,
  __name 
)
#define FIFO_BOOL_TYPE   int
#define FIFO_CURSOR_TYPE   uint16_t
#define FIFO_DECL   static
#define FIFO_INLINE   inline
#define FIFO_NULL   { FIFO_ZERO_INIT, 0, 0, 0 }
#define FIFO_SYNC   __sync_synchronize()
#define FIFO_VOLATILE
#define FIFO_ZERO_INIT   {0}