Ring buffer impl

Implemented ring buffer with inline push and pop functions
Updated copyrights on main.c and ring_buffer files
This commit is contained in:
2026-06-02 16:52:07 +02:00
parent 5e904177de
commit cfc59a9593
3 changed files with 152 additions and 141 deletions

View File

@@ -0,0 +1,14 @@
// Copyright (C) 2026 Hector van der Aa <hector@h3cx.dev>
// Copyright (C) 2026 Association Exergie <association.exergie@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#include <stdint.h>
typedef struct ring_buffer_t {
uint32_t buffer[256];
uint8_t w_head;
uint8_t r_head;
} ring_buffer_t;
inline void ringBufferPush(ring_buffer_t *rb, uint32_t value);
inline int ringBufferPop(ring_buffer_t *rb, uint32_t *output);