Open
Conversation
tonhuisman
reviewed
Feb 27, 2026
Comment on lines
+190
to
+193
| value = adapt_ledc_frequency_resolution_duty(frequency, resolution, value); | ||
| ledChannel = attachLedChannel(pin, frequency, resolution); | ||
| lastPin = pin; | ||
| lastFreq = frequency; |
Contributor
There was a problem hiding this comment.
Some of the formatting is off here 🤔
tonhuisman
reviewed
Feb 27, 2026
| return ledChannelFreq[ledChannel]; | ||
| # else // if ESP_IDF_VERSION_MAJOR < 5 | ||
| ledcWrite(pin, value); | ||
| ledcWrite(pin, value); |
Contributor
There was a problem hiding this comment.
Not sure why that space was added, formatter generated?
Contributor
Author
There was a problem hiding this comment.
good question and i have no answer to that :)
Contributor
Author
There was a problem hiding this comment.
It seems like I forgot to do a last format...
TD-er
reviewed
Feb 27, 2026
| value = adapt_ledc_frequency_resolution_duty(frequency, resolution, value); | ||
| int8_t ledChannel = attachLedChannel(pin, frequency, resolution); | ||
| // Only update frequency & attach channel if pin/freq changed | ||
| if ((lastPin != pin) || (lastFreq != frequency)) { |
Member
There was a problem hiding this comment.
I think there were also functions in the ledC class to query the actual used frequency.
So this way you don't need to rely on locally kept states as the ledC class can also be used outside of our ESPEasy wrapper functions.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I use the PWM command to fade LED stripes. After updating to a recent build, I realised that when calling the PWM command, it causes the PWM-pin to reinitialise every time, which leads to a flicker of the LEDs even when issuing the command with the same duty cycle.
Not sure if my changes are perfect, but they solve the problem for me.