Skip to content

Fix pwm out resets after suspend #13492

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 43 commits into from
Sep 10, 2020
Merged

Fix pwm out resets after suspend #13492

merged 43 commits into from
Sep 10, 2020

Conversation

talorion
Copy link
Contributor

@talorion talorion commented Aug 25, 2020

Summary of changes

Fixed a Problem where PwmOut resets settings after suspend.
The problem is described here: #13480

Impact of changes

Fixes: #13480

Migration actions required

Documentation

None

Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[x] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Aug 25, 2020
@ciarmcom ciarmcom requested review from bentcooke, maclobdell, toyowata and a team August 25, 2020 22:00
@ciarmcom
Copy link
Member

@talorion, thank you for your changes.
@toyowata @bentcooke @maclobdell @ARMmbed/mbed-os-hal @ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 31, 2020

Thanks @talorion . Lot of work done here to update all the targets.

Fixed a Problem where PwmOut resets settings after suspend.

Can you describe how this is fixing it ? I see here adding new methods to PWMOut object.The description should describe the problem this is fixing.

This should be rather a new feature (adding new functionality), although it fixes the issue, feature addition is more important here. Please update the above template.

The previous suggestion was start/stop option, how does this compare (providing read methods instead to be able to write back?).

@talorion
Copy link
Contributor Author

talorion commented Sep 1, 2020

Thanks @talorion . Lot of work done here to update all the targets.

Fixed a Problem where PwmOut resets settings after suspend.

Can you describe how this is fixing it ? I see here adding new methods to PWMOut object.The description should describe the problem this is fixing.

This should be rather a new feature (adding new functionality), although it fixes the issue, feature addition is more important here. Please update the above template.

The previous suggestion was start/stop option, how does this compare (providing read methods instead to be able to write back?).

@0xc0170
PwmOut provides the methods PwmOut::suspend and PwmOut::resume
in the current implementation only the duty cycle is saved in PwmOut::suspend to be rewritten in PwmOut::resume
depending on the implementation of the PWM this can lead to problems like that the duty cycle stays the same but the period is reset to its initial state.

such a problem is described in #13480

the problem is very dependent on the implementation if just the duty cycle is given. So the simplest solution for me was to add methods to the pwmout_api that read the period in additon to the duty cycle, so it can be saved and set in PwmOut::suspend and PwmOut::resume.

@mergify
Copy link

mergify bot commented Sep 2, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@talorion
Copy link
Contributor Author

talorion commented Sep 8, 2020

@talorion Many thanks for your work. PR looks good apart from some variable names. I'm approving but please fix those.

i changed the variable names

@talorion
Copy link
Contributor Author

talorion commented Sep 8, 2020

@stevew817 I fixed the order of operations

@kyle-cypress
Copy link

The changes in TARGET_Cypress look good to me.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 9, 2020

I started CI, I'll review meanwhile

@mergify mergify bot added needs: CI and removed needs: review labels Sep 9, 2020
@mbed-ci
Copy link

mbed-ci commented Sep 9, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-ARM ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️

@0xc0170 0xc0170 added release-type: feature and removed release-type: patch Indentifies a PR as containing just a patch labels Sep 10, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Sep 10, 2020

I've set this to "Feature" as it adds new API (to drivers/hal).

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.

PwmOut resets settings after suspend.