-
Notifications
You must be signed in to change notification settings - Fork 162
rp2xxx: Fix pins apply semantics #843
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
Conversation
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
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.
🔍 Lint Results
ℹ️ Additional issues on unchanged lines
The following 5 issue(s) exist but are not on lines changed in this PR:
port/raspberrypi/rp2xxx/build.zig:92: TODO style comments need to have a linked microzig issue on the same line.
port/raspberrypi/rp2xxx/build.zig:143: TODO style comments need to have a linked microzig issue on the same line.
port/raspberrypi/rp2xxx/build.zig:308: Suggestion: Rename `BootROM` to `Boot_ROM`, it _should_ be more in line with our [style guidelines](https://microzig.tech/docs/contributing/). This automation is not perfect so take it with a grain of salt.
port/raspberrypi/rp2xxx/src/boards/adafruit_metro_rp2350.zig:5: TODO style comments need to have a linked microzig issue on the same line.
port/raspberrypi/rp2xxx/src/hal/pins.zig:878: TODO style comments need to have a linked microzig issue on the same line.
Grazfather
commented
Jan 10, 2026
Grazfather
commented
Jan 10, 2026
Grazfather
commented
Jan 10, 2026
tact1m4n3
approved these changes
Jan 11, 2026
- Change hal.pins.apply(comptime config) to return PinsType(), matching consensus across HALs (WCH, STM32, GD32). - Keep pins() API for compatibility with existing code. - Add @Hasfield guard in pins() to only assign fields that exist in PinsType; avoids "no field named ... " when configs define only non-SIO/PWM/ADC functions or use custom names. - Update rp2xxx examples to use "const pins = pin_config.apply();" (or discard when unused). - Update getting-started docs snippet to the consensus pattern. - Built representative examples successfully (SIO, PWM, UART/I2C, watchdog, RP2040/RP2350).
92f9625 to
2b07a0e
Compare
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.
pins.apply()match other HALs, where it returns the pinsblinky_core1out of rp2040_only: I tested it on rp2350board_blinkyexample, which is likeblinky, but it uses the board's configured GPIO namedledto toggle.