-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix LED buffer size calculation #4928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
18aab48
Attempt at better bus memory calculation and estimation
blazoncek e922d0f
Remov double buffer count for ESP8266 (thanks @dedehai)
blazoncek 857a041
adding mendatory LED buffers to UI memory calculation
DedeHai 8fc1db0
adding buffer for transitions to memory calculation, change "error" t…
DedeHai 287d3d4
bugfixes in settings_leds.htm
DedeHai bfed6d6
Merge branch 'main' into buffercalc_fix
DedeHai 8884bb5
fix getDataSize() forESP8266
DedeHai e711b74
update led settings UI, add new warnings, fix parsing by @blazoncek
DedeHai 2f98c48
revert unnecessary changes
DedeHai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
|
|
@@ -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 | ||
| dC += (isDig(t) && !isD2P(t)); | ||
| setPinConfig(n,t); | ||
| gId("abl"+n).style.display = (!abl || !isDig(t)) ? "none" : "inline"; // show/hide individual ABL settings | ||
|
|
@@ -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 | ||
|
||
| 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 | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nis used both as character and a number ingetMem().I prefer to have number instead of character.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
nhas to be converted.There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.