19 lines
327 B
C
19 lines
327 B
C
#ifndef RING_BUFFER_H
|
|
#define RING_BUFFER_H
|
|
|
|
#define RING_BUFFER_SIZE 32
|
|
|
|
#include <stdint.h>
|
|
|
|
struct ring_buffer
|
|
{
|
|
uint8_t buffer[RING_BUFFER_SIZE];
|
|
uint8_t read;
|
|
uint8_t write;
|
|
};
|
|
|
|
uint8_t read_entry(struct ring_buffer *buf);
|
|
void write_entry(struct ring_buffer *buf, uint8_t entry);
|
|
|
|
#endif /* !RING_BUFFER_H */
|