From 0d8c4ac5fb09f139e6b7003ec4f3608b37fe0f8b Mon Sep 17 00:00:00 2001 From: RickDB Date: Mon, 14 Mar 2016 21:19:47 +0100 Subject: [PATCH] Correctly set buffer size based on number of leds so that it works with non-standard AtmoOrb setups. Former-commit-id: 6aec2410d6e870c8489e565269f2990e3a9e1b85 --- libsrc/leddevice/LedDeviceAtmoOrb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/leddevice/LedDeviceAtmoOrb.cpp b/libsrc/leddevice/LedDeviceAtmoOrb.cpp index e99c864b..869cc932 100644 --- a/libsrc/leddevice/LedDeviceAtmoOrb.cpp +++ b/libsrc/leddevice/LedDeviceAtmoOrb.cpp @@ -88,7 +88,7 @@ int LedDeviceAtmoOrb::write(const std::vector & ledValues) { void LedDeviceAtmoOrb::setColor(unsigned int orbId, const ColorRgb& color, int commandType) { QByteArray bytes; - bytes.resize(5 + 24 * 3); + bytes.resize(5 + numLeds * 3); // Command identifier: C0FFEE bytes[0] = 0xC0; @@ -121,7 +121,7 @@ int LedDeviceAtmoOrb::switchOff() { for (int i = 0; i < orbIds.size(); i++) { QByteArray bytes; - bytes.resize(5 + 24 * 3); + bytes.resize(5 + numLeds * 3); // Command identifier: C0FFEE bytes[0] = 0xC0;