Skip to content

Commit

Permalink
Update wled_serial.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Apr 3, 2021
1 parent d66a30d commit 7ab53de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wled00/wled_serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ enum class AwaProtocol {
};

// static data buffer for the loop
#define MAX_BUFFER 2048

void handleSerial()
{
static uint8_t buffer[4096];
static uint8_t buffer[MAX_BUFFER];
static AwaProtocol state = AwaProtocol::HEADER_A;
static uint8_t CRC = 0;
static uint16_t count = 0;
Expand All @@ -30,7 +31,7 @@ void handleSerial()
static uint8_t inputColorB = 0;

uint16_t bufferPointer = 0;
uint16_t internalIndex = min(Serial.available(), 4096);
uint16_t internalIndex = min(Serial.available(), MAX_BUFFER);

if (internalIndex > 0)
internalIndex = Serial.readBytes(buffer, internalIndex);
Expand Down

0 comments on commit 7ab53de

Please sign in to comment.