Cleanup cores/arduino/commonZephyr.cpp, cores/arduino/Arduino.h#168
Merged
soburi merged 4 commits intozephyrproject-rtos:nextfrom Mar 2, 2026
Merged
Cleanup cores/arduino/commonZephyr.cpp, cores/arduino/Arduino.h#168soburi merged 4 commits intozephyrproject-rtos:nextfrom
soburi merged 4 commits intozephyrproject-rtos:nextfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR ports upstream “common” cleanup fixes into the Zephyr-based Arduino core, aiming to make devicetree-driven digital pin handling more robust and to address build warnings.
Changes:
- Adds conditional compilation around devicetree-derived pin/port computations when
digital_pin_gpiosis empty/missing. - Refactors devicetree pin-matching macros to avoid macro-expansion edge cases and adds a helper macro for pin lookup.
- Silences an unused-parameter warning in the GPIO callback.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
cores/arduino/zephyrCommon.cpp |
Adds digital_pin_gpios length gating for compile-time port/pin calculations; suppresses unused port warning. |
cores/arduino/Arduino.h |
Updates/extends devicetree macros for pin matching and makes digitalPins enum generation conditional. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Added a condition that the length of digital_pin_gpios is 0 or more. ------------------------------------------------------------------- Pick: arduino@d20ef628 Co-Authored-by: Martino Facchin <m.facchin@arduino.cc> Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
…sues The DIGITAL_PIN_EXISTS macro (used e.g. by LED_BUILTIN) was not working properly because the inline comments in devicetree_generated.h were confusing the preprocessor: one internal macro tried to create an unsigned constant by pasting a '*/' comment end marker with the 'U' character. Splitting that macro into two parts, so that the DT_REG_ADDR macro is invoked with an expanded argument, fixes the issue. ------------------------------------------------------------------- Pick: arduino@84651c2c Signed-off-by: Luca Burelli <l.burelli@arduino.cc> Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add `DIGITAL_PIN_GPIOS_FIND_NODE` helper macro. ------------------------------------------------------------------- Pick: arduino@a60cd82a Co-Authored-by: Sebastian Romero <s.romero@arduino.cc> Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Silence a number of trivial compiler warnings in the Arduino core: - unused arguments - "constexpr const" ------------------------------------------------------------------ Pick: arduino@67251fb Signed-off-by: Luca Burelli <l.burelli@arduino.cc> Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
DhruvaG2000
approved these changes
Mar 2, 2026
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.
Merge following fix from https://github.com/arduino/ArduinoCore-zephyr/.