Fixed ring_buffer's linking problems
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (C) 2026 Hector van der Aa <hector@h3cx.dev>
|
// Copyright (C) 2026 Hector van der Aa <hector@h3cx.dev>
|
||||||
// Copyright (C) 2026 Association Exergie <association.exergie@gmail.com>
|
// Copyright (C) 2026 Association Exergie <association.exergie@gmail.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#pragma once
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
typedef struct ring_buffer_t {
|
typedef struct ring_buffer_t {
|
||||||
uint32_t buffer[256];
|
uint32_t buffer[256];
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
#include <ring_buffer.h>
|
#include <ring_buffer.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
inline void ringBufferPush(ring_buffer_t *rb, uint32_t value) {
|
void ringBufferPush(ring_buffer_t *rb, uint32_t value) {
|
||||||
rb->buffer[rb->w_head] = value;
|
rb->buffer[rb->w_head] = value;
|
||||||
rb->w_head++;
|
rb->w_head++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline uint32_t ringBufferRead(ring_buffer_t *rb, uint8_t idx) {
|
uint32_t ringBufferRead(ring_buffer_t *rb, uint8_t idx) {
|
||||||
return rb->buffer[rb->w_head - 1 - idx];
|
return rb->buffer[rb->w_head - 1 - idx];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user