Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit ba15d22

Browse files
committed
Added additional zeroes after LPD6803 device message
1 parent e8bde19 commit ba15d22

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

deploy/hyperion.tar.gz

217 Bytes
Binary file not shown.

libsrc/leddevice/LedDeviceLpd6803.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ LedDeviceLpd6803::LedDeviceLpd6803(const std::string& outputDevice, const unsign
1919

2020
int LedDeviceLpd6803::write(const std::vector<ColorRgb> &ledValues)
2121
{
22+
unsigned messageLength = 4 + 2*ledValues.size() + ledValues.size()/8 + 1;
2223
// Reconfigure if the current connfiguration does not match the required configuration
23-
if (4 + 2*ledValues.size() != _ledBuffer.size())
24+
if (messageLength != _ledBuffer.size())
2425
{
2526
// Initialise the buffer
26-
_ledBuffer.resize(4 + 2*ledValues.size(), 0x00);
27+
_ledBuffer.resize(messageLength, 0x00);
2728
}
2829

2930
// Copy the colors from the ColorRgb vector to the Ldp6803 data vector

0 commit comments

Comments
 (0)