diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index 95772a443f..be7a786e9f 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -451,7 +451,7 @@ struct BusConfig { //validates start and length and extends total if needed bool adjustBounds(uint16_t& total) { 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; //limit length of strip if it would exceed total permissible LEDs if (start + count > MAX_LEDS) count = MAX_LEDS - start; diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index 2cd5e28393..abe09d5582 100644 --- a/wled00/data/settings_leds.htm +++ b/wled00/data/settings_leds.htm @@ -330,33 +330,29 @@ } // do we have a led count field 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 if (!customStarts || !startsDirty[toNum(n)]) gId("ls"+n).value = sLC; //update start value gId("ls"+n).disabled = !customStarts; //enable/disable field editing if (c) { let s = parseInt(gId("ls"+n).value); //start value 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 (isDig(t)) { + if (c > maxLC) maxLC = c; //max per output sDI += c; // summarize digital LED count 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) } } // increase led count 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) if (nm.search(/^L[0-3]/) == 0) { // pin fields if (isVir(t)) {