-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
adding dynamic update of LED type dropdown #5014
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
Open
DedeHai
wants to merge
6
commits into
wled:main
Choose a base branch
from
DedeHai:fix_LEDtype_selection
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
025be3b
adding dynamic update of LED type dropdown, remove restriction
DedeHai 0e0e1ac
call updateTypeDropdowns() at end of UI(), bugfix
DedeHai 7ce356a
add clarifying comments
DedeHai d89b7f9
bugfix: dont allow additional digital buses
DedeHai d0fdaf2
move updateTypeDropdowns()
DedeHai 31c3356
add comment as suggested by the rabbit
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
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
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.
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.
🧩 Analysis chain
Verify the maxDB calculation logic.
The arithmetic
(!d.Sf["PR"].checked) * 8 - (!isS3())produces unexpected results. When parallel I2S is enabled (PR.checked = true) and not on S3, this evaluates to0 * 8 - 1 = -1, which increasesmaxDBtomaxD + 1. This seems incorrect unless there's a specific hardware reason for allowing more digital buses in that configuration.Additionally, using boolean-to-number coercion (
(!condition) * 8) reduces readability compared to an explicit conditional.Consider refactoring for clarity and correctness:
Please verify this matches the intended hardware constraints.
I need to investigate the actual code and its context to verify the review comment. Let me examine the repository.
🏁 Script executed:
Length of output: 1888
🏁 Script executed:
Length of output: 1353
🏁 Script executed:
Length of output: 82
🏁 Script executed:
Length of output: 59
🏁 Script executed:
Length of output: 796
🏁 Script executed:
Length of output: 317
🏁 Script executed:
Length of output: 5155
🏁 Script executed:
Length of output: 1837
🏁 Script executed:
Length of output: 1566
🏁 Script executed:
Length of output: 1273
🏁 Script executed:
Length of output: 143
🏁 Script executed:
Length of output: 85
🏁 Script executed:
Length of output: 165
🏁 Script executed:
Length of output: 1216
🏁 Script executed:
Length of output: 1474
🏁 Script executed:
Length of output: 1039
🏁 Script executed:
Length of output: 0
I need to check the C++ firmware source to understand the hardware constraints behind this formula.
🏁 Script executed:
Length of output: 1215
🏁 Script executed:
Length of output: 3022
🏁 Script executed:
Length of output: 2545
🏁 Script executed:
Length of output: 1600
🏁 Script executed:
Length of output: 1501
🏁 Script executed:
Length of output: 707
🏁 Script executed:
Length of output: 1864
Fix the maxDB calculation to prevent allowing more digital buses than hardware supports.
The formula
(!d.Sf["PR"].checked) * 8 - (!isS3())produces incorrect results when parallel I2S is enabled. On ESP32 and S2 boards with PR checked, this evaluates to-1, makingmaxDB = maxD + 1. This allows the UI to show capacity for more digital buses than the hardware maximum.The issue is inconsistent: S3 correctly returns
maxDwhen PR is checked, but ESP32 and S2 incorrectly exceed their hardware limits.Likely intended logic: reduce capacity by 8 when NOT using parallel I2S (when PR is unchecked). The subtraction of
(!isS3())appears to be attempting a per-board adjustment but uses subtraction instead of addition, inverting the logic.Replace with:
Or refactor for clarity:
Verify that
(!isS3())reduction is intentional for S2/ESP32 when parallel I2S is enabled.🤖 Prompt for AI Agents
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.
@blazoncek this line is unchanged from previous code. is this the indended behaviour or is the rabbit right?
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.
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.
S2 : 5/12
S3 : 4/12
32 : 9/16
These are supported configurations. First number is with parallel I2S disabled/unchecked.
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.
The formula above is correct.