diff options
Diffstat (limited to 'lf_ringbuffer_data.h')
-rw-r--r-- | lf_ringbuffer_data.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lf_ringbuffer_data.h b/lf_ringbuffer_data.h new file mode 100644 index 0000000..80092d5 --- /dev/null +++ b/lf_ringbuffer_data.h @@ -0,0 +1,20 @@ + +typedef char rb_data_t; + +#define RB_DATA_LEN 24 + +typedef struct buffer { + char status; + rb_data_t data[RB_DATA_LEN]; +} rb_buffer_t; + +#define LFRB_DATA_SIZE ( sizeof(rb_data_t)*RB_DATA_LEN ) + +#define LFRB_BUFFER_TYPE rb_buffer_t +#define LFRB_BUFFER_SIZE ( sizeof(rb_buffer_t) ) + +#define LFRB_IS_AVAILABLE( el ) (el.status==0) +#define LFRB_MARK_AS_FILLED( el ) { (el).status=1; } +#define LFRB_MARK_AS_READ( el ) { (el).status=0; } +#define LFRB_DATA_PTR( el ) (el).data + |