diff options
author | Thomas Albers Raviola <thomas@thomaslabs.org> | 2024-12-03 21:52:59 +0100 |
---|---|---|
committer | Thomas Albers Raviola <thomas@thomaslabs.org> | 2024-12-03 21:52:59 +0100 |
commit | 7a8c601eec433f7c75d3291d64bb3d41fe50c8ae (patch) | |
tree | 1b1038a4dc80cc496a4c608ea760300f8b6d68f1 /include/fifo.h | |
parent | 08b7ee440269c881546421da6efe1b6ae122b566 (diff) |
Use custom types
Diffstat (limited to 'include/fifo.h')
-rw-r--r-- | include/fifo.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/fifo.h b/include/fifo.h index c6eee2d..5fec62f 100644 --- a/include/fifo.h +++ b/include/fifo.h @@ -6,22 +6,22 @@ #define FIFO_LEN 32 struct fifo { - uint8_t head; - uint8_t tail; - uint8_t data[FIFO_LEN]; + u8 head; + u8 tail; + u8 data[FIFO_LEN]; }; -static inline uint8_t +static inline u8 fifo_pop(struct fifo *fifo) { - uint8_t ret = fifo->data[fifo->head]; + u8 ret = fifo->data[fifo->head]; if (++fifo->head >= LENGTH(fifo->data)) fifo->head = 0; return ret; } static inline void -fifo_push(struct fifo *fifo, uint8_t v) +fifo_push(struct fifo *fifo, u8 v) { fifo->data[fifo->tail] = v; |