Skip to content

Conversation

@bogdanarduino
Copy link
Collaborator

In ArduinoCore-zephyr\cores\arduino\Arduino.h, the built-in LED index was changed from 0 (RED) to 1 (GREEN).

Copy link

@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.

This PR is changing a global default, which must be available even on boards that only have 1 LED defined.
Please fix this by setting LED_BUILTIN to the appropriate number or macro in each variant (variants/xxx/pins_arduino.h).

@sebromero
Copy link

@pillo79 @bogdanarduino Maybe instead of changing it in the variant file, it might be cleaner to change it in the device tree overlay? I suppose builtin-led-gpios can have duplicate entries. So, the first index could always refer to the BUILTIN_LED, while the other entries are for RGB etc. e.g. for Giga it could be:

builtin-led-gpios = <&gpioj 13 GPIO_ACTIVE_LOW> // Green
                    <&gpioi 12 GPIO_ACTIVE_LOW>, // Red
                    <&gpioj 13 GPIO_ACTIVE_LOW>, // Green
                    <&gpioe 3 GPIO_ACTIVE_LOW>; // Blue

Wdyt?

@facchinm
Copy link
Member

Compeltely agree with @sebromero , the right way to tackle this is via device tree

…ed the fix as overlay config instead, for R1, C33 and H7.
@bogdanarduino
Copy link
Collaborator Author

Thank you all for your feedback! Please recheck the updated fix when you have time.

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