MeterLogger
ringbuf.h
Go to the documentation of this file.
1 #ifndef _RING_BUF_H_
2 #define _RING_BUF_H_
3 
4 #include <esp8266.h>
5 #include "typedef.h"
6 
7 typedef struct{
8  U8* p_o; /**< Original pointer */
9  U8* volatile p_r; /**< Read pointer */
10  U8* volatile p_w; /**< Write pointer */
11  volatile I32 fill_cnt; /**< Number of filled slots */
12  I32 size; /**< Buffer size */
13 }RINGBUF;
14 
18 #endif
I16 ICACHE_FLASH_ATTR RINGBUF_Get(RINGBUF *r, U8 *c)
get a character from ring buffer
Definition: ringbuf.c:53
I16 ICACHE_FLASH_ATTR RINGBUF_Put(RINGBUF *r, U8 c)
put a character into ring buffer
Definition: ringbuf.c:32
Definition: ringbuf.h:7
short I16
Definition: typedef.h:11
U8 * p_o
Definition: ringbuf.h:8
long I32
Definition: typedef.h:13
#define ICACHE_FLASH_ATTR
Definition: c_types.h:99
I16 ICACHE_FLASH_ATTR RINGBUF_Init(RINGBUF *r, U8 *buf, I32 size)
init a RINGBUF object
Definition: ringbuf.c:16
unsigned char U8
Definition: typedef.h:10
U8 *volatile p_w
Definition: ringbuf.h:10
volatile I32 fill_cnt
Definition: ringbuf.h:11
I32 size
Definition: ringbuf.h:12
U8 *volatile p_r
Definition: ringbuf.h:9