Library dir: lib/AutoWire/ -> lib/KLine/ Site title, docs, CLAUDE.md, platformio.ini all updated. All 4 firmware environments build clean.
26 lines
498 B
C++
26 lines
498 B
C++
#pragma once
|
|
// Ring buffer for async I/K-Bus message handling
|
|
// Based on muki01/I-K_Bus RingBuffer (MIT license)
|
|
|
|
#include <Arduino.h>
|
|
|
|
class RingBuffer {
|
|
public:
|
|
RingBuffer(int size);
|
|
~RingBuffer();
|
|
|
|
int available();
|
|
int capacity(); // usable slots (size - 1, ring buffer wastes one)
|
|
int peek();
|
|
int peek(int n);
|
|
void remove(int n);
|
|
int read();
|
|
byte write(int c);
|
|
|
|
private:
|
|
int _size;
|
|
unsigned int _head;
|
|
unsigned int _tail;
|
|
byte* _buf;
|
|
};
|