Remove MAX_LEDS_PER_BUS limitation for virtual buses (#5238)
- Frontend: Updated settings_leds.htm to allow virtual buses up to 16384 LEDs - Backend: Modified BusConfig::adjustBounds() to skip MAX_LEDS_PER_BUS check for virtual buses Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com>
This commit is contained in:
@@ -488,7 +488,7 @@ struct BusConfig {
|
|||||||
//validates start and length and extends total if needed
|
//validates start and length and extends total if needed
|
||||||
bool adjustBounds(uint16_t& total) {
|
bool adjustBounds(uint16_t& total) {
|
||||||
if (!count) count = 1;
|
if (!count) count = 1;
|
||||||
if (count > MAX_LEDS_PER_BUS) count = MAX_LEDS_PER_BUS;
|
if (!Bus::isVirtual(type) && count > MAX_LEDS_PER_BUS) count = MAX_LEDS_PER_BUS;
|
||||||
if (start >= MAX_LEDS) return false;
|
if (start >= MAX_LEDS) return false;
|
||||||
//limit length of strip if it would exceed total permissible LEDs
|
//limit length of strip if it would exceed total permissible LEDs
|
||||||
if (start + count > MAX_LEDS) count = MAX_LEDS - start;
|
if (start + count > MAX_LEDS) count = MAX_LEDS - start;
|
||||||
|
|||||||
@@ -346,33 +346,29 @@
|
|||||||
}
|
}
|
||||||
// do we have a led count field
|
// do we have a led count field
|
||||||
if (nm=="LC") {
|
if (nm=="LC") {
|
||||||
|
if (!isHub75(t)) {
|
||||||
|
LC.max = isAna(t) ? 1 : (isDig(t) ? maxPB : 16384); // set max value
|
||||||
|
} else {
|
||||||
|
LC.min = undefined;
|
||||||
|
LC.max = undefined;
|
||||||
|
}
|
||||||
let c = parseInt(LC.value,10); //get LED count
|
let c = parseInt(LC.value,10); //get LED count
|
||||||
if (!customStarts || !startsDirty[toNum(n)]) gId("ls"+n).value = sLC; //update start value
|
if (!customStarts || !startsDirty[toNum(n)]) gId("ls"+n).value = sLC; //update start value
|
||||||
gId("ls"+n).disabled = !customStarts; //enable/disable field editing
|
gId("ls"+n).disabled = !customStarts; //enable/disable field editing
|
||||||
if (c) {
|
if (c) {
|
||||||
let s = parseInt(gId("ls"+n).value); //start value
|
let s = parseInt(gId("ls"+n).value); //start value
|
||||||
if (s+c > sLC) sLC = s+c; //update total count
|
if (s+c > sLC) sLC = s+c; //update total count
|
||||||
if (c > maxLC) maxLC = c; //max per output
|
|
||||||
if (!isVir(t)) sPC += c; //virtual out busses do not count towards physical LEDs
|
if (!isVir(t)) sPC += c; //virtual out busses do not count towards physical LEDs
|
||||||
if (isDig(t)) {
|
if (isDig(t)) {
|
||||||
|
if (c > maxLC) maxLC = c; //max per output
|
||||||
sDI += c; // summarize digital LED count
|
sDI += c; // summarize digital LED count
|
||||||
let maPL = parseInt(d.Sf["LA"+n].value);
|
let maPL = parseInt(d.Sf["LA"+n].value);
|
||||||
if (maPL == 255) maPL = 12;
|
if (maPL == 255) maPL = 12; // wacky WS2815 mode (255 == 12mA per LED)
|
||||||
busMA += maPL*c; // summarize maximum bus current (calculated)
|
busMA += maPL*c; // summarize maximum bus current (calculated)
|
||||||
}
|
}
|
||||||
} // increase led count
|
} // increase led count
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// do we have led pins for digital leds
|
|
||||||
if (nm=="L0" || nm=="L1") {
|
|
||||||
if (!isHub75(t)) {
|
|
||||||
d.Sf["LC"+n].max = maxPB; // update max led count value
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
d.Sf["LC"+n].min = undefined;
|
|
||||||
d.Sf["LC"+n].max = undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// ignore IP address (stored in pins for virtual busses)
|
// ignore IP address (stored in pins for virtual busses)
|
||||||
if (nm.search(/^L[0-3]/) == 0) { // pin fields
|
if (nm.search(/^L[0-3]/) == 0) { // pin fields
|
||||||
if (isVir(t)) {
|
if (isVir(t)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user