Skip to content

Fix PWM driver of RZ/A1 #9952

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 5 commits into from
Mar 17, 2019
Merged

Fix PWM driver of RZ/A1 #9952

merged 5 commits into from
Mar 17, 2019

Conversation

d-kato
Copy link
Contributor

@d-kato d-kato commented Mar 6, 2019

Description

Fixed a bug that caused noise when the duty was 0% and 100%.
And added pwm pin for GR-LYCHEE.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

@ciarmcom ciarmcom requested review from toyowata and a team March 6, 2019 12:00
@ciarmcom
Copy link
Member

ciarmcom commented Mar 6, 2019

@d-kato, thank you for your changes.
@toyowata @ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@toyowata toyowata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me, but need a bit detail commit message:
ff32b41

E.g. description of the bug and how/what fix this.

Copy link
Contributor

@cmonr cmonr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split the fix, pin addition, and code refactoring into seperate commits.

PR content looks fine.


// Counter Restart
if ((MTU2TSTR & tmp_tstr_st) == 0) {
MTU2TSTR |= tmp_tstr_st;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the TIOR register, the output is fixed to Low when the duty is 0%, and fixed to Hi when 100%.
To change the TIOR register, the counter is temporarily stopped.

@d-kato
Copy link
Contributor Author

d-kato commented Mar 7, 2019

I splitted the commit.

Copy link
Contributor

@cmonr cmonr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Thank you! The split makes reviewing considerably easier!

@d-kato
Copy link
Contributor Author

d-kato commented Mar 11, 2019

I'm sorry. As an additional change, I changed condition statement of writing function.

@cmonr
Copy link
Contributor

cmonr commented Mar 13, 2019

@d-kato No worries. You at least let us know about it, which is appreciated.

@d-kato
Copy link
Contributor Author

d-kato commented Mar 14, 2019

@cmonr, I do not want to change the value of the TIOR register frequently.
As the method, originally, it was judged from the values of period and pulse set last. However, with this method, it is considered that the relationship between period and pulse may be broken due to a calculation error when the "pwmout_period_us()" is executed.
So I decided to change the TIOR register if it was not the value I wanted to set.

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 15, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Mar 16, 2019

Test run: SUCCESS

Summary: 13 of 13 test jobs passed
Build number : 1
Build artifacts

cmonr pushed a commit to cmonr/mbed-os that referenced this pull request Mar 16, 2019
cmonr pushed a commit to cmonr/mbed-os that referenced this pull request Mar 16, 2019
@cmonr cmonr merged commit a637551 into ARMmbed:master Mar 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants