MeterLogger
mqtt
include
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
15
I16
ICACHE_FLASH_ATTR
RINGBUF_Init
(
RINGBUF
*r,
U8
* buf,
I32
size);
16
I16
ICACHE_FLASH_ATTR
RINGBUF_Put
(
RINGBUF
*r,
U8
c);
17
I16
ICACHE_FLASH_ATTR
RINGBUF_Get
(
RINGBUF
*r,
U8
* c);
18
#endif
RINGBUF_Get
I16 ICACHE_FLASH_ATTR RINGBUF_Get(RINGBUF *r, U8 *c)
get a character from ring buffer
Definition:
ringbuf.c:53
RINGBUF_Put
I16 ICACHE_FLASH_ATTR RINGBUF_Put(RINGBUF *r, U8 c)
put a character into ring buffer
Definition:
ringbuf.c:32
RINGBUF
Definition:
ringbuf.h:7
I16
short I16
Definition:
typedef.h:11
RINGBUF::p_o
U8 * p_o
Definition:
ringbuf.h:8
I32
long I32
Definition:
typedef.h:13
ICACHE_FLASH_ATTR
#define ICACHE_FLASH_ATTR
Definition:
c_types.h:99
typedef.h
RINGBUF_Init
I16 ICACHE_FLASH_ATTR RINGBUF_Init(RINGBUF *r, U8 *buf, I32 size)
init a RINGBUF object
Definition:
ringbuf.c:16
U8
unsigned char U8
Definition:
typedef.h:10
esp8266.h
RINGBUF::p_w
U8 *volatile p_w
Definition:
ringbuf.h:10
RINGBUF::fill_cnt
volatile I32 fill_cnt
Definition:
ringbuf.h:11
RINGBUF::size
I32 size
Definition:
ringbuf.h:12
RINGBUF::p_r
U8 *volatile p_r
Definition:
ringbuf.h:9
Generated by
1.8.13