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
387 B

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