From 1a92e6ccd2248ce4c49c7891bb74ec5b54e0a3f1 Mon Sep 17 00:00:00 2001 From: johan Date: Fri, 21 Feb 2014 22:35:13 +0100 Subject: [PATCH] Added additional zeroes after LPD6803 device message Former-commit-id: ba15d222339736e5281e667270ddb37b50d1319f --- deploy/hyperion.tar.gz.REMOVED.git-id | 2 +- libsrc/leddevice/LedDeviceLpd6803.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/deploy/hyperion.tar.gz.REMOVED.git-id b/deploy/hyperion.tar.gz.REMOVED.git-id index e3115d3b..440b9e4d 100644 --- a/deploy/hyperion.tar.gz.REMOVED.git-id +++ b/deploy/hyperion.tar.gz.REMOVED.git-id @@ -1 +1 @@ -f3afa39f64294a9ce71af8e424e4bab72d2b29cb \ No newline at end of file +8f880f994b0855ace23e27818896fc34ba1677a8 \ No newline at end of file diff --git a/libsrc/leddevice/LedDeviceLpd6803.cpp b/libsrc/leddevice/LedDeviceLpd6803.cpp index bfaa010b..09d5f838 100644 --- a/libsrc/leddevice/LedDeviceLpd6803.cpp +++ b/libsrc/leddevice/LedDeviceLpd6803.cpp @@ -19,11 +19,12 @@ LedDeviceLpd6803::LedDeviceLpd6803(const std::string& outputDevice, const unsign int LedDeviceLpd6803::write(const std::vector &ledValues) { + unsigned messageLength = 4 + 2*ledValues.size() + ledValues.size()/8 + 1; // 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 - _ledBuffer.resize(4 + 2*ledValues.size(), 0x00); + _ledBuffer.resize(messageLength, 0x00); } // Copy the colors from the ColorRgb vector to the Ldp6803 data vector