Arduino.h: Correct LED_BUILTIN define order#147
Arduino.h: Correct LED_BUILTIN define order#147DhruvaG2000 merged 1 commit intozephyrproject-rtos:nextfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request combines two separate features: correcting the LED_BUILTIN definition order in Arduino.h to allow board-specific overrides, and adding support for board-revision-specific overlay files and improved variant directory resolution in the build system.
Changes:
- Modified Arduino.h to define LED_BUILTIN_ (with underscore) before including variant.h, then conditionally define LED_BUILTIN from LED_BUILTIN_ only if not already defined, allowing board-specific definitions to take precedence
- Updated all sample CMakeLists.txt files to support board-revision-specific overlay files with fallback to standard overlay files
- Modified main CMakeLists.txt to normalize NORMALIZED_BOARD_TARGET and support both BOARD and NORMALIZED_BOARD_TARGET variant directory paths
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| cores/arduino/Arduino.h | Reorders LED_BUILTIN macro definitions to allow board-specific variant.h files to override default LED definitions |
| CMakeLists.txt | Adds string normalization for NORMALIZED_BOARD_TARGET and supports multiple variant directory lookup paths |
| samples/threads_arduino/CMakeLists.txt | Adds support for board-revision-specific overlay files with fallback |
| samples/spi_controller/CMakeLists.txt | Adds support for board-revision-specific overlay files with fallback |
| samples/serial_event/CMakeLists.txt | Adds support for board-revision-specific overlay files with fallback |
| samples/i2cdemo/CMakeLists.txt | Adds support for board-revision-specific overlay files with fallback |
| samples/hello_arduino/CMakeLists.txt | Adds support for board-revision-specific overlay files with fallback |
| samples/fade/CMakeLists.txt | Adds support for board-revision-specific overlay files with fallback |
| samples/button_press_led/CMakeLists.txt | Adds support for board-revision-specific overlay files with fallback |
| samples/blinky_arduino/CMakeLists.txt | Adds support for board-revision-specific overlay files with fallback |
| samples/attach_interrupt/CMakeLists.txt | Adds support for board-revision-specific overlay files with fallback |
| samples/analog_input/CMakeLists.txt | Adds support for board-revision-specific overlay files with fallback |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3aad91d to
e43b776
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e43b776 to
7e78b21
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7e78b21 to
e653024
Compare
pillo79
left a comment
There was a problem hiding this comment.
LGTM! One small nit for your consideration.
e653024 to
57c8f71
Compare
DhruvaG2000
left a comment
There was a problem hiding this comment.
Functionality-wise we always had a ifndef LED_BUILTIN guarding this section so I am not expecting anything to change much. This approach does look cleaner now
Correct the order of LED_BUILTIN definitions so that board-specific definitions of LED_BUILTIN take precedence. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
57c8f71 to
eb56cb9
Compare
Correct the order of LED_BUILTIN definitions so that board-specific
definitions of LED_BUILTIN take precedence.