Skip to content

Commit 38b7743

Browse files
authored
Live update WLED/udpraw LEDs number (#564)
1 parent e1d6544 commit 38b7743

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Diff for: sources/leddevice/dev_net/LedDeviceUdpRaw.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ int LedDeviceUdpRaw::write(const std::vector<ColorRgb>& ledValues)
2525
{
2626
const uint8_t* dataPtr = reinterpret_cast<const uint8_t*>(ledValues.data());
2727

28+
if (ledValues.size() != _ledCount)
29+
setLedCount(ledValues.size());
30+
2831
return writeBytes(_ledRGBCount, dataPtr);
2932
}

Diff for: sources/leddevice/dev_net/LedDeviceWled.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -309,5 +309,8 @@ int LedDeviceWled::write(const std::vector<ColorRgb>& ledValues)
309309
{
310310
const uint8_t* dataPtr = reinterpret_cast<const uint8_t*>(ledValues.data());
311311

312+
if (ledValues.size() != _ledCount)
313+
setLedCount(ledValues.size());
314+
312315
return writeBytes(_ledRGBCount, dataPtr);
313316
}

0 commit comments

Comments
 (0)