Updated ring buffer to match use case, one write head with negative read index
14 lines
417 B
C
14 lines
417 B
C
// 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;
|
|
} ring_buffer_t;
|
|
|
|
inline void ringBufferPush(ring_buffer_t *rb, uint32_t value);
|
|
|
|
inline uint32_t ringBufferRead(ring_buffer_t *rb, uint8_t idx);
|