mirror of https://github.com/jeelabs/esp-link.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
504 B
18 lines
504 B
#ifndef _RING_BUF_H_
|
|
#define _RING_BUF_H_
|
|
|
|
#include <esp8266.h>
|
|
#include "typedef.h"
|
|
|
|
typedef struct{
|
|
U8* p_o; /**< Original pointer */
|
|
U8* volatile p_r; /**< Read pointer */
|
|
U8* volatile p_w; /**< Write pointer */
|
|
volatile I32 fill_cnt; /**< Number of filled slots */
|
|
I32 size; /**< Buffer size */
|
|
}RINGBUF;
|
|
|
|
I16 ICACHE_FLASH_ATTR RINGBUF_Init(RINGBUF *r, U8* buf, I32 size);
|
|
I16 ICACHE_FLASH_ATTR RINGBUF_Put(RINGBUF *r, U8 c);
|
|
I16 ICACHE_FLASH_ATTR RINGBUF_Get(RINGBUF *r, U8* c);
|
|
#endif
|
|
|