card-os/include/ring-buffer.h
2026-05-26 05:59:38 -04:00

23 lines
403 B
C

#ifndef CARD_OS_RING_BUFFER
#define CARD_OS_RING_BUFFER
#include "user/card-os.h"
enum
{
OS_RING_BUFFER_SIZE = 16
};
typedef struct
{
unsigned int write_index;
unsigned int read_index;
os_message buffer[OS_RING_BUFFER_SIZE];
} os_ring_buffer;
int os_ring_buffer_write(volatile os_ring_buffer* ring_buffer,
const os_message* message);
#endif // CARD_OS_RING_BUFFER