Skip to content

Arduino.h: Correct LED_BUILTIN define order#147

Merged
DhruvaG2000 merged 1 commit intozephyrproject-rtos:nextfrom
soburi:led_builtin_order
Feb 5, 2026
Merged

Arduino.h: Correct LED_BUILTIN define order#147
DhruvaG2000 merged 1 commit intozephyrproject-rtos:nextfrom
soburi:led_builtin_order

Conversation

@soburi
Copy link
Copy Markdown
Member

@soburi soburi commented Jan 31, 2026

Correct the order of LED_BUILTIN definitions so that board-specific
definitions of LED_BUILTIN take precedence.

@soburi soburi changed the title Led builtin order Arduino.h: Correct LED_BUILTIN define order Jan 31, 2026
@soburi soburi marked this pull request as ready for review February 1, 2026 13:47
Copilot AI review requested due to automatic review settings February 1, 2026 13:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@soburi soburi marked this pull request as draft February 1, 2026 14:25
@soburi soburi force-pushed the led_builtin_order branch from 3aad91d to e43b776 Compare February 3, 2026 10:55
@soburi soburi requested a review from Copilot February 3, 2026 11:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@soburi soburi marked this pull request as ready for review February 3, 2026 12:17
@soburi soburi force-pushed the led_builtin_order branch from 7e78b21 to e653024 Compare February 3, 2026 13:28
Copy link
Copy Markdown
Contributor

@pillo79 pillo79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! One small nit for your consideration.

@soburi soburi force-pushed the led_builtin_order branch from e653024 to 57c8f71 Compare February 3, 2026 14:00
@soburi soburi requested a review from pillo79 February 3, 2026 14:02
Copy link
Copy Markdown
Member

@DhruvaG2000 DhruvaG2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@soburi soburi force-pushed the led_builtin_order branch from 57c8f71 to eb56cb9 Compare February 3, 2026 21:28
@soburi soburi requested a review from DhruvaG2000 February 3, 2026 21:34
@DhruvaG2000 DhruvaG2000 merged commit 49fc8d5 into zephyrproject-rtos:next Feb 5, 2026
3 checks passed
@soburi soburi deleted the led_builtin_order branch February 5, 2026 10:44
@soburi soburi mentioned this pull request Feb 14, 2026
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants