mirror of
https://github.com/wled/WLED.git
synced 2025-07-19 16:56:35 +00:00
Fix for missing WLED_NUM_PINS check
This commit is contained in:
parent
e34f179a82
commit
d5777b7bce
@ -1262,7 +1262,8 @@ void WS2812FX::finalizeInit() {
|
|||||||
DEBUG_PRINTLN(F("No available pins left! Can't configure output."));
|
DEBUG_PRINTLN(F("No available pins left! Can't configure output."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// is the newly assigned pin already defined? try next in line until there are no clashes
|
// is the newly assigned pin already defined or used previously?
|
||||||
|
// try next in line until there are no clashes or we run out of pins
|
||||||
bool clash;
|
bool clash;
|
||||||
do {
|
do {
|
||||||
clash = false;
|
clash = false;
|
||||||
@ -1275,14 +1276,16 @@ void WS2812FX::finalizeInit() {
|
|||||||
}
|
}
|
||||||
// We already have a clash on current bus, no point checking next buses
|
// We already have a clash on current bus, no point checking next buses
|
||||||
if (!clash) {
|
if (!clash) {
|
||||||
// check for conflicts on next buses
|
// check for conflicts in defined pins
|
||||||
for (unsigned k = pinsIndex + busPins; k < defNumPins; k++) {
|
for (const auto &pin : defDataPins) {
|
||||||
if (defDataPins[k] == defPin[j]) {
|
if (pin == defPin[j]) {
|
||||||
clash = true;
|
clash = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (clash) defPin[j]++;
|
if (clash) defPin[j]++;
|
||||||
|
if (defPin[j] >= WLED_NUM_PINS) break;
|
||||||
} while (clash);
|
} while (clash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user