mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Added additional zeroes after LPD6803 device message
Former-commit-id: ba15d222339736e5281e667270ddb37b50d1319f
This commit is contained in:
parent
fe6bfb0ad2
commit
1a92e6ccd2
@ -1 +1 @@
|
|||||||
f3afa39f64294a9ce71af8e424e4bab72d2b29cb
|
8f880f994b0855ace23e27818896fc34ba1677a8
|
@ -19,11 +19,12 @@ LedDeviceLpd6803::LedDeviceLpd6803(const std::string& outputDevice, const unsign
|
|||||||
|
|
||||||
int LedDeviceLpd6803::write(const std::vector<ColorRgb> &ledValues)
|
int LedDeviceLpd6803::write(const std::vector<ColorRgb> &ledValues)
|
||||||
{
|
{
|
||||||
|
unsigned messageLength = 4 + 2*ledValues.size() + ledValues.size()/8 + 1;
|
||||||
// Reconfigure if the current connfiguration does not match the required configuration
|
// Reconfigure if the current connfiguration does not match the required configuration
|
||||||
if (4 + 2*ledValues.size() != _ledBuffer.size())
|
if (messageLength != _ledBuffer.size())
|
||||||
{
|
{
|
||||||
// Initialise the buffer
|
// Initialise the buffer
|
||||||
_ledBuffer.resize(4 + 2*ledValues.size(), 0x00);
|
_ledBuffer.resize(messageLength, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy the colors from the ColorRgb vector to the Ldp6803 data vector
|
// Copy the colors from the ColorRgb vector to the Ldp6803 data vector
|
||||||
|
Loading…
Reference in New Issue
Block a user