cpu/esp8266: fix pwm_set func#10982
Merged
MrKevinWeiss merged 1 commit intoRIOT-OS:masterfrom Jun 27, 2019
Merged
Conversation
70d121f to
aa3f17e
Compare
20 tasks
Contributor
For your testing procedure you should maybe clarify use term not test (it has happened in a few PRs) |
Contributor
MrKevinWeiss
left a comment
There was a problem hiding this comment.
It seems like the pwm osci with those settings have some issues on master and this PR seems to resolve them. Tested with a scope.
It seems the code adds (80315 - 80223) 92 bytes or so, but I don't know how you can reduce so I think it is good.
Contributor
|
Thanks, I will have it tested by tomorrow afternoon |
Contributor
MrKevinWeiss
left a comment
There was a problem hiding this comment.
I think the signs are messed up. It doesn't work anymore.
MrKevinWeiss
approved these changes
Jun 26, 2019
Contributor
MrKevinWeiss
left a comment
There was a problem hiding this comment.
Tested again, all good. Please squash. ACK
In the `pwm_set` function, the switch-on and switch-off times for PWM channels were only determined for the following phase, but not for the current phase. This could result in a missing duty cycle when calling the function `pwm_set` if the switch-on time of the current phase was not yet reached or to an extended duty cycle if the switch-off time of the current phase had not yet been reached.
d3b11fc to
d3e0b78
Compare
Contributor
Author
|
@MrKevinWeiss Thanks for reviewing and testing. |
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.
Contribution description
In
pwm_setfunction, switch-on and switch-off times for PWM channels were only determined for the following phase, but not for the current phase. This could result inpwm_setwas called before switch-on time of the current phase orpwm_setwas called before switch-off time of the current phase.This PR fixes the problem.
Testing procedure
Use
test/periph_pwmwith following changes inmain.c:Flash the application with and without the changes in this PR to compare the results.
Execute the
oscicommand. Without the changes of this PR, you should be able to observe one extended duty cycle every 9th cycles. That is,pwm_setfunction is executed in 10th cycle and does not switch off the output port.With changes of this PR, the output port should be switched on and off also in 10th cycle.