Skip to content

Add some rounding to determine the pulse value for PWM for the STM target #9105

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

Conversation

LaurentLouf
Copy link
Contributor

@LaurentLouf LaurentLouf commented Dec 14, 2018

Description

The changes are pretty obvious : when computing the pulse value for PWM in the function pwmout_write, no rounding was performed, so for very small periods (think <10µs), it could cause quite a large offset for changes in pulse values. This pull request solves that by adding one of the most common way to round a value after float to int casting.

Pull request type

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

Fix for a particular set of targets, haven't checked if this omission is also present on other targets.

@LaurentLouf LaurentLouf changed the title Add some rounding to determine the pulse value for PWM for the STM ta… Add some rounding to determine the pulse value for PWM for the STM target Dec 14, 2018
@ciarmcom ciarmcom requested a review from a team December 14, 2018 12:00
@ciarmcom
Copy link
Member

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

Copy link
Contributor

@LMESTM LMESTM left a comment

Choose a reason for hiding this comment

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

Looks good to me - thanks for the Pull request !

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 14, 2018

@LaurentLouf Thanks for the contribution, this is now approved and will be moved to CI stage

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 14, 2018

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 14, 2018

Failure not related, and seeing it the first time (will track this one)

Restarting

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 17, 2018

Test restarted

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 17, 2018

Restarted entire pipeline

@mbed-ci
Copy link

mbed-ci commented Dec 17, 2018

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

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