Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Controllers/ArcticController/ArcticController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ static void FormatCommandBuffer(char *buffer, char command)

void ArcticController::SetChannels(std::vector<RGBColor> colors)
{
char* buffer = new char[ARCTIC_COMMAND_BUFFER_LENGTH(colors.size() * 3)];
size_t buffer_length = ARCTIC_COMMAND_BUFFER_LENGTH(colors.size() * 3);
char* buffer = new char[buffer_length];

FormatCommandBuffer(buffer, ARCTIC_COMMAND_SET_RGB);

Expand All @@ -81,7 +82,7 @@ void ArcticController::SetChannels(std::vector<RGBColor> colors)
buffer[offset + 0x02] = (char)std::min<unsigned int>(254, RGBGetBValue(colors[channel]));
}

serialport.serial_write(buffer, sizeof(buffer));
serialport.serial_write(buffer, buffer_length);

delete[] buffer;
}
Expand Down
Loading