Repository navigation
Reject RP2040 3-PWM pins sharing a compare channel - #590
Draft
misaacastillo wants to merge 1 commit into
Draft
misaacastillo wants to merge 1 commit into
misaacastillo wants to merge 1 commit into
Conversation
Check the resolved PWM slice and channel before allocation or configuration. Preserve valid pairs of distinct channels on the same slice. Prepared with Codex and verified with host tests and Pico builds.
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes #589.
The RP2040 3-PWM configuration now checks the resolved slice and channel
for each phase before allocating driver parameters or configuring GPIO.
Different channels on the same slice remain valid. The check uses the same
pin mapping as PWM setup, including Arduino pin remapping.
Type of change
Verification
demonstrates the failure in the original driver.
writes and preserve independent compare values for valid pins. The test
covers RP2040 and RP2350 builds, with both direct GPIO numbers and remapped
Arduino pins.
BLDCDriver3PWMsketch with PlatformIO and Arduino-Picofor Raspberry Pi Pico and Pico 2 W. Physical PWM and motor testing remain
pending.
Re-run the host regression
Download
verify-fix.shand run
sh verify-fix.shwith a C++17 compiler, curl, and shasum. It fetchesand hash-checks the exact base and head driver revisions. The baseline
accepts the GP0/GP16 alias. The patch rejects conflicts before register
writes and preserves independent duty writes in all four host builds.
The two firmware builds used PlatformIO Raspberry Pi RP2040
1.17.0+sha.22a4cc6, Arduino-Pico1.50201.0+sha.ded8a8a, and ARM GCC14.2.0. Host models and successful builds cover the checks above. Physical
PWM verification remains pending.
Prepared with Codex assistance. This draft is open for maintainer feedback.