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

Commit b5be5f6

Browse files
committed
Merge pull request #364 from AEtHeLsYn/master
End Frame fixed (Issue #361)
2 parents 062ecb5 + 4410799 commit b5be5f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libsrc/leddevice/LedDeviceAPA102.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ LedDeviceAPA102::LedDeviceAPA102(const std::string& outputDevice, const unsigned
2020

2121
int LedDeviceAPA102::write(const std::vector<ColorRgb> &ledValues)
2222
{
23-
const unsigned int mLedCount = (ledValues.size() * 4) + 8;
23+
const unsigned int startFrameSize = 4;
24+
const unsigned int endFrameSize = (ledValues.size() + 63) / 64 * 4;
25+
const unsigned int mLedCount = (ledValues.size() * 4) + startFrameSize + endFrameSize;
2426
if(_ledBuffer.size() != mLedCount){
2527
_ledBuffer.resize(mLedCount, 0x00);
2628
}

0 commit comments

Comments
 (0)