diff options
author | Thomas Albers Raviola <thomas@thomaslabs.org> | 2025-02-12 01:56:34 +0100 |
---|---|---|
committer | Thomas Albers Raviola <thomas@thomaslabs.org> | 2025-02-12 01:56:34 +0100 |
commit | 13c0217bf19a2ddfb24b673455f6d362a46ebf7b (patch) | |
tree | 6ffa6f9fd1da195d8887f2d718729a071812dfcc /include/fifo.h | |
parent | 779b9834e30de1ba0b4f0755388bebd0c45aa1dc (diff) |
Tabify source code
Diffstat (limited to 'include/fifo.h')
-rw-r--r-- | include/fifo.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/include/fifo.h b/include/fifo.h index 5fec62f..1af51ec 100644 --- a/include/fifo.h +++ b/include/fifo.h @@ -6,40 +6,40 @@ #define FIFO_LEN 32 struct fifo { - u8 head; - u8 tail; - u8 data[FIFO_LEN]; + u8 head; + u8 tail; + u8 data[FIFO_LEN]; }; static inline u8 fifo_pop(struct fifo *fifo) { - u8 ret = fifo->data[fifo->head]; - if (++fifo->head >= LENGTH(fifo->data)) - fifo->head = 0; - return ret; + 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, u8 v) { - fifo->data[fifo->tail] = v; + fifo->data[fifo->tail] = v; - if (++fifo->tail >= LENGTH(fifo->data)) - fifo->tail = 0; + if (++fifo->tail >= LENGTH(fifo->data)) + fifo->tail = 0; } static inline bool fifo_empty(const struct fifo *fifo) { - return (fifo->head == fifo->tail); + return (fifo->head == fifo->tail); } static inline void fifo_clear(struct fifo *fifo) { - fifo->head = 0; - fifo->tail = 0; + fifo->head = 0; + fifo->tail = 0; } #endif // FIFO_H |