[common] Make Serial RX buffer size configurable, increase default to 256 bytes (#313)

* Make Serial RX buffer configurable and set default to 256 bytes

* Replace RingBuffer by SerialRingBuffer
This commit is contained in:
Hajo Noerenberg
2025-01-13 12:14:41 +01:00
committed by GitHub
parent 3d23211c1e
commit 2ea0066536
7 changed files with 14 additions and 8 deletions

View File

@@ -8,6 +8,8 @@
using namespace arduino;
typedef RingBufferN<LT_SERIAL_BUFFER_SIZE> SerialRingBuffer;
class SerialClass : public HardwareSerial {
private:
uint32_t port;
@@ -18,7 +20,7 @@ class SerialClass : public HardwareSerial {
void *data;
private:
RingBuffer *buf;
SerialRingBuffer *buf;
uint32_t baudrate;
uint16_t config;

View File

@@ -27,7 +27,7 @@ typedef enum {
typedef struct {
SoftState state;
RingBuffer *buf;
SerialRingBuffer *buf;
uint8_t byte;
pin_size_t pin;
void *param;

View File

@@ -77,6 +77,10 @@
#define LT_UART_DEFAULT_SERIAL LT_UART_DEFAULT_PORT
#endif
#ifndef LT_SERIAL_BUFFER_SIZE
#define LT_SERIAL_BUFFER_SIZE 256
#endif
// Misc options
#ifndef LT_USE_TIME
#define LT_USE_TIME 0