-
-
Notifications
You must be signed in to change notification settings - Fork 41
Variants: Changed 'built-in' LED from RED to GREEN on R1, C33 and H7. #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Variants: Changed 'built-in' LED from RED to GREEN on R1, C33 and H7. #265
Conversation
pillo79
left a comment
There was a problem hiding this 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).
|
@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 Wdyt? |
|
Compeltely agree with @sebromero , the right way to tackle this is via device tree |
|
Thank you all for your feedback! Please recheck the updated fix when you have time. |
|
Hi @bogdanarduino could you please reword the commits and the PR title to make CI happy ? The pattern is
|
pennam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a dts expert here, but I'm wondering if there is any specific reason to add a new
/ {
zephyr,user {
instead of changing what we already have some lines above
builtin-led-gpios = <&ioport1 7 GPIO_ACTIVE_LOW>,
<&ioport4 0 GPIO_ACTIVE_LOW>,
<&ioport8 0 GPIO_ACTIVE_LOW>;
a97a5a6 to
78c3dae
Compare
78c3dae to
79c2af0
Compare
|
@pillo79 Do we have your blessing? |
pillo79
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebromero, I discussed this with @facchinm right now - the way the code currently uses builtin-led-gpios is not very effective, because only the first entry is ever used.
We settled on:
- @bogdanarduino, please duplicate the GREEN entry in the existing boards, so that the sequence in the list is effectively G-R-G-B . This will "fix" the current LED_BUILTIN macro to use the green LED.
- as a next step, we will add code that uses indexes 1-3 of that array (when the variant defines them) to set
LEDR,LEDGandLEDBin that sequence. That way the current list will not change. This also supports targets that have separate builtin and RGB LEDs.
Ok, clear, I will do the change very soon. Thank you for reviewing! |
In ArduinoCore-zephyr\cores\arduino\Arduino.h, the built-in LED index was changed from 0 (RED) to 1 (GREEN).