This repository has been archived on 2021-02-04. You can view files and clone it, but cannot push or open issues or pull requests.
keyboard.old/include/fifo.h
2020-12-30 03:22:45 +01:00

20 lines
309 B
C

#ifndef FIFO_h
#define FIFO_h
#include <stdint.h>
#define FIFO_SIZE 64
struct FIFO {
int head;
int tail;
int size;
uint8_t buffer[FIFO_SIZE];
};
void FIFO_push(volatile struct FIFO* fifo, uint8_t value);
uint8_t FIFO_pop(volatile struct FIFO* fifo);
int FIFO_size(volatile struct FIFO* fifo);
#endif