-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix for PWM resume issue, SWINTEGRATION-57 #15139
Conversation
@billwatersiii, thank you for your changes. |
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.
Approved
CI started |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
@0xc0170, the checks that are failing don't have anything to do with the one file that I modified in this pull request. Is this something that you can look into and resolve? |
Yes, looking at it now. |
There was a fix merged few days back #15138 - can you rebase this pull request? I'll restart testing. |
b44afe3
to
a2e4652
Compare
@0xc0170, the rebase is complete. Please restart testing. |
Ci restarted |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
This is a workaround for the problem described here - #15135 (comment)
The PwmOut::resume() function in mbed-os/drivers/source/PwmOut.cpp sets the "percentage of the period" (the duty cycle) before it sets the period.
We capture the duty cycle in microseconds when the
PwmOut::write()->pwmout_write()
function is called. We do not update the duty cycle when thePwmOut::period_us()->pwmout_period_us()
function is called. Before this update, we didn't have the percent value to do so. With this update, the percent value is saved wheneverpwmout_write()
is called. And the percentage is used, when appropriate, in thepwmout_period_us()
function. If the duty cycle is updated with a time value before thepwmout_period_us()
function is called, that percentage will not be used.There are no Greentea or Unittest that cover this functionality. The problem can be observed on the output of the pin. This was manually tested by multiple team members at Infineon.
Impact of changes
Likely none. If there is an impact, it will be positive. The PWM signal will now be correct and as expected after
PwmOut::resume()
is called.Migration actions required
Not applicable
Documentation
None
Pull request type
Test results
Reviewers
@ARMMbed/team-cypress