Skip to content
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

Nuvoton: Enlarge NuMaker PWM duty cycle range #14379

Merged
merged 3 commits into from
Mar 11, 2021

Conversation

cyliangtw
Copy link
Contributor

Summary of changes

This PR is to enlarge PWM duty cycle range of NuMaker platforms. The old range is only 0 ~ 100 and can't support higher duty cycle range. In this PR, the range is 0 ~ 10000 and could fulfill MCU usage.

Impact of changes

None

Migration actions required

None

Documentation

None


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] 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 Mar 4, 2021
@ciarmcom
Copy link
Member

ciarmcom commented Mar 4, 2021

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

@ccli8
Copy link
Contributor

ccli8 commented Mar 9, 2021

@cyliangtw PWM_ConfigOutputChannel still following BSP and PWM_ConfigOutputChannel2 extended, how about change below:

uint32_t PWM_ConfigOutputChannel(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle)
{
return PWM_ConfigOutputChannel2(pwm, u32ChannelNum, u32Frequency, u32DutyCycle, 1);
}

To:

uint32_t PWM_ConfigOutputChannel (PWM_T *pwm,
                                  uint32_t u32ChannelNum,
                                  uint32_t u32Frequency,
                                  uint32_t u32DutyCycle)
{
    return PWM_ConfigOutputChannel2(pwm, u32ChannelNum, u32Frequency, u32DutyCycle*100, 1);
}

@cyliangtw
Copy link
Contributor Author

@cyliangtw PWM_ConfigOutputChannel still following BSP and PWM_ConfigOutputChannel2 extended, how about change below:

uint32_t PWM_ConfigOutputChannel(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle)
{
return PWM_ConfigOutputChannel2(pwm, u32ChannelNum, u32Frequency, u32DutyCycle, 1);
}

To:

uint32_t PWM_ConfigOutputChannel (PWM_T pwm,
uint32_t u32ChannelNum,
uint32_t u32Frequency,
uint32_t u32DutyCycle)
{
return PWM_ConfigOutputChannel2(pwm, u32ChannelNum, u32Frequency, u32DutyCycle
100, 1);
}

@ccli8 , The goal is to increase the resolution of duty from 100 to 10000 to fulfill our demand. Your modification is confused and pwmout_api.c existing implementation already call PWM_ConfigOutputChannel2() directly. More, proprietary BSP m251_pwm.c also suffer the same issue and will follow the same methodology.

0xc0170
0xc0170 previously approved these changes Mar 9, 2021
@mergify mergify bot added needs: CI and removed needs: review labels Mar 9, 2021
@mergify mergify bot dismissed 0xc0170’s stale review March 10, 2021 03:55

Pull request has been modified.

@adbridge
Copy link
Contributor

CI started

@mergify mergify bot added needs: work and removed needs: CI labels Mar 10, 2021
@mbed-ci
Copy link

mbed-ci commented Mar 10, 2021

Jenkins CI Test : ❌ FAILED

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-greentea-ARM
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM
jenkins-ci/mbed-os-ci_build-cloud-example-ARM
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM
jenkins-ci/mbed-os-ci_build-example-GCC_ARM

@cyliangtw
Copy link
Contributor Author

After check Logs & Artifacts of Jenkins CI Test, it's failed in build other vendor's target , such like as K64F or DISCO_L475VG_IOT01A.
However, this PR's modification is only for Nuvoton targets and can't affect other vendor's target.
So, this Jenkins CI Test failure should be no matter with this PR.

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 11, 2021

We had internal issue with CI yesterday, its fixed now.

CI restarted

@mbed-ci
Copy link

mbed-ci commented Mar 11, 2021

Jenkins CI Test : ✔️ SUCCESS

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

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

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.

7 participants