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.

19 lines
327 B

#ifndef __RINGBSML_H
#define __RINGBSML_H
#include <stdint.h>
typedef struct {
char* startptr;
uint8_t size;
uint8_t readpos;
uint8_t writepos;
} ringbuf_t;
void ringbuf_init(ringbuf_t* rb, char* buf, int size);
uint8_t ringbuf_put(ringbuf_t *rb, uint8_t value);
int16_t ringbuf_get(ringbuf_t *rb);
#endif