-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/gd32v: add periph_pwm support #19209
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When a timer is set, any pending interrupts must be cleared before the interrupt is enabled for the channel. Otherwise the interrupt would be triggered immediately when the timer is set.
The default timer configuration has been changed so that `TIMER0` and `TIMER1` are always timer devices. `TIMER2` can only be used as timer device if it is not used for PWM devices. `TIMER3` and `TIMER4` are only available as timer devices if they are supported by the CPU model and not used for PWM devices.
gschorcht
requested review from
leandrolanzieri,
jia200x and
MrKevinWeiss
as code owners
January 28, 2023 17:18
github-actions
bot
added
Area: boards
Area: Board ports
Area: cpu
Area: CPU/MCU ports
Area: doc
Area: Documentation
Area: Kconfig
Area: Kconfig integration
Area: tools
Area: Supplementary tools
labels
Jan 28, 2023
benpicco
added
the
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
label
Jan 29, 2023
benpicco
approved these changes
Jan 29, 2023
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.
bors merge
🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
Build succeeded: |
@benpicco Thanks for reviewing and merging |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: boards
Area: Board ports
Area: cpu
Area: CPU/MCU ports
Area: doc
Area: Documentation
Area: Kconfig
Area: Kconfig integration
Area: tools
Area: Supplementary tools
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
This PR provides the
periph_pwm
support for GD32VF103.It includes a bug fix (2c6e527) of
periph_timer
which clears pending interrupts on setting the timer before the interrupt is enabled. This avoids that a pending interrupt is triggered immediately when the timer is set. The bug causedtests/periph_timer
andtests/periph_timer_periodic
to crash. (I could split-off this bug fix if necessary).Furthermore, the default timer configuration has been extended and reordered.
TIMER0
can be used now as timer device (0dfbdeb). The default timer configuration has been changed (377b5b3) so thatTIMER0
andTIMER1
are always timer devices.TIMER2
can only be used as timer device if it is not used for PWM devices.TIMER3
andTIMER4
are only available as timer devices if they are supported by the CPU model and not used for PWM devices.Testing procedure
tests/periph_timer
andtests/periph_timer_periodic
should work now. Without the PR, these tests lead to kernel panic.tests/periph_pwm
should work on any GD32VF103 board. Commandosci
should also let LED1 and LED2 oscillate.Issues/PRs references