Ryan Malloy 2aaa6e32a5 Rename library from AutoWire to K-Line
Library dir: lib/AutoWire/ -> lib/KLine/
Site title, docs, CLAUDE.md, platformio.ini all updated.
All 4 firmware environments build clean.
2026-02-13 08:31:34 -07:00

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;
};