Fix ADC_PINS and PWM_PINS compilation in global-GPIO mode#10
Merged
soburi merged 5 commits intoFeb 10, 2026
Conversation
When adc_pin_gpios or pwm_pin_gpios are used without digital_pin_gpios (global-GPIO mode), the DIGITAL_PIN_GPIOS_FIND_PIN macro is not available. This commit adds conditional compilation to use ZARD_GLOBAL_GPIO_NUM in global-GPIO mode, which derives the global GPIO number from the GPIO specifier (port and pin). Fixes compilation issue when using adc-pin-gpios or pwm-pin-gpios in global-GPIO mode. Co-authored-by: soburi <458281+soburi@users.noreply.github.com>
Align continuation lines consistently with the rest of the code style. Co-authored-by: soburi <458281+soburi@users.noreply.github.com>
Co-authored-by: soburi <458281+soburi@users.noreply.github.com>
Remove accidentally committed CodeQL build artifacts from the repository and add them to .gitignore to prevent future commits. Co-authored-by: soburi <458281+soburi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Address feedback from review on connector def PR
Fix ADC_PINS and PWM_PINS compilation in global-GPIO mode
Feb 10, 2026
There was a problem hiding this comment.
Pull request overview
Fixes build failures in Zephyr “global-GPIO” mode by making ADC_PINS and PWM_PINS work when digital_pin_gpios is not defined (and DIGITAL_PIN_GPIOS_FIND_PIN is therefore unavailable).
Changes:
- Add conditional compilation for
PWM_PINSto fall back to global GPIO numbering viaZARD_GLOBAL_GPIO_NUM(...) + pinwhendigital_pin_gpiosis absent. - Add the same conditional compilation for
ADC_PINS. - Ignore CodeQL build artifacts in
.gitignore.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cores/arduino/zephyrCommon.cpp | Adds digital_pin_gpios-aware fallbacks so PWM/ADC pin mapping compiles in global-GPIO mode. |
| .gitignore | Ignores CodeQL-generated build directories/files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
When
adc_pin_gpiosorpwm_pin_gpiosare used withoutdigital_pin_gpios, theDIGITAL_PIN_GPIOS_FIND_PINmacro is unavailable, causing compilation failure.Changes
ADC_PINSandPWM_PINSmacros: Added conditional compilation to useZARD_GLOBAL_GPIO_NUMwhendigital_pin_gpiosis absent, deriving global GPIO numbers directly from GPIO specifiers (port + pin).This aligns with the existing approach used in
analogPinsenum (Arduino.h:162-169).💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.