Skip to content
10 changes: 5 additions & 5 deletions wled00/data/settings_leds.htm
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@
if (is8266() && d.Sf["L0"+n].value == 3) { //8266 DMA uses 5x the mem
mul = 5;
}
let parallelI2S = d.Sf.PR.checked && (is32() || isS2() || isS3) && !isD2P(t);
let parallelI2S = d.Sf.PR.checked && (is32() || isS2() || isS3()) && !isD2P(t);
if (isC3() || (isS3() && !parallelI2S)) {
mul = 2; // ESP32 RMT uses double buffer
} else if ((is32() || isS2() || isS3) && n > (parallelI2S ? 7 : 0)) {
} else if ((is32() || isS2() || isS3()) && n > (parallelI2S ? 7 : 0)) {
mul = 2; // ESP32 RMT uses double buffer
} else if ((parallelI2S && n < 8) || (n == 0 && is32())) { // I2S uses extra DMA buffer
dbl = len * ch * 3; // DMA buffer for parallel I2S (TODO: ony the bus with largst LED count should be used)
dbl = len * ch * 3; // DMA buffer for parallel I2S (TODO: only the bus with largest LED count should be used)
}
}
return len * ch * mul + dbl + pbfr;
Expand Down Expand Up @@ -266,7 +266,7 @@
// is the field a LED type?
var n = s.name.substring(2);
var t = parseInt(s.value);
memu += getMem(t, parseInt(n)); // calc memory
memu += getMem(t, n); // calc memory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n is used both as character and a number in getMem().
I prefer to have number instead of character.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but isnt n passed as 0-9 and A-Z ? can 'A' be parsed into int?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct, but the solution presented here is not correct. n has to be converted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you added a fix to your fork, do you mind adding that to this PR too? I am struggling a bit with JS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will once I get back from my trip.

Copy link
Collaborator Author

@DedeHai DedeHai Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I managed to extract it. At least it worked in tests but please check.

dC += (isDig(t) && !isD2P(t));
setPinConfig(n,t);
gId("abl"+n).style.display = (!abl || !isDig(t)) ? "none" : "inline"; // show/hide individual ABL settings
Expand Down Expand Up @@ -304,7 +304,7 @@
var nList = d.Sf.querySelectorAll("#mLC input[name^=L]");
nList.forEach((LC,i)=>{
let nm = LC.name.substring(0,2); // field name
let n = parseInt(LC.name.substring(2)); // bus number
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

let n = LC.name.substring(2); // bus number
let t = parseInt(d.Sf["LT"+n].value); // LED type SELECT
if (isDig(t)) {
if (sameType == 0) sameType = t; // first bus type
Expand Down