Update LedDeviceAPA102.cpp

Former-commit-id: 164b396f7d779d01e2fc1df80438ad817a0ac712
This commit is contained in:
AEtHeLsYn 2015-11-04 14:05:09 +01:00
parent 9d004fa36e
commit 958aa428a3

View File

@ -25,7 +25,11 @@ int LedDeviceAPA102::write(const std::vector<ColorRgb> &ledValues)
const unsigned int endFrameSize = std::max<unsigned int>(((ledValues.size() + 15) / 16), 4);
const unsigned int mLedCount = (ledValues.size() * 4) + startFrameSize + endFrameSize;
if(_ledBuffer.size() != mLedCount){
_ledBuffer.resize(mLedCount, 0x00);
_ledBuffer.resize(mLedCount, 0xFF);
}
for (unsigned iLed=0; iLed<startFrameSize; ++iLed) {
_ledBuffer[iLed] = 0x00;
}
for (unsigned iLed=1; iLed<=ledValues.size(); ++iLed) {