mirror of
https://github.com/wled/WLED.git
synced 2025-07-23 18:56:41 +00:00
fix pin conflict check logic
This commit is contained in:
parent
6a90b9a512
commit
e34f179a82
@ -1266,12 +1266,23 @@ void WS2812FX::finalizeInit() {
|
|||||||
bool clash;
|
bool clash;
|
||||||
do {
|
do {
|
||||||
clash = false;
|
clash = false;
|
||||||
for (const auto &pin : defDataPins) {
|
// check for conflicts on current bus
|
||||||
if (pin == defPin[j]) {
|
for (const auto &pin : defPin) {
|
||||||
defPin[j]++;
|
if (&pin != &defPin[j] && pin == defPin[j]) {
|
||||||
if (defPin[j] < WLED_NUM_PINS) clash = true;
|
clash = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// We already have a clash on current bus, no point checking next buses
|
||||||
|
if (!clash) {
|
||||||
|
// check for conflicts on next buses
|
||||||
|
for (unsigned k = pinsIndex + busPins; k < defNumPins; k++) {
|
||||||
|
if (defDataPins[k] == defPin[j]) {
|
||||||
|
clash = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (clash) defPin[j]++;
|
||||||
} while (clash);
|
} while (clash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user