Skip to content

Commit 7ab53de

Browse files
committed
Update wled_serial.cpp
1 parent d66a30d commit 7ab53de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

wled00/wled_serial.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ enum class AwaProtocol {
1515
};
1616

1717
// static data buffer for the loop
18+
#define MAX_BUFFER 2048
1819

1920
void handleSerial()
2021
{
21-
static uint8_t buffer[4096];
22+
static uint8_t buffer[MAX_BUFFER];
2223
static AwaProtocol state = AwaProtocol::HEADER_A;
2324
static uint8_t CRC = 0;
2425
static uint16_t count = 0;
@@ -30,7 +31,7 @@ void handleSerial()
3031
static uint8_t inputColorB = 0;
3132

3233
uint16_t bufferPointer = 0;
33-
uint16_t internalIndex = min(Serial.available(), 4096);
34+
uint16_t internalIndex = min(Serial.available(), MAX_BUFFER);
3435

3536
if (internalIndex > 0)
3637
internalIndex = Serial.readBytes(buffer, internalIndex);

0 commit comments

Comments
 (0)