drivers/led: add LEDX_IS_PRESENT defines#20637
Merged
maribu merged 1 commit intoRIOT-OS:masterfrom Apr 30, 2024
Merged
Conversation
maribu
reviewed
Apr 29, 2024
Member
maribu
left a comment
There was a problem hiding this comment.
Looks good to me, but the CI will insist on the documentation.
I do agree that the name is self-documenting, but the CI doesn't have this intuition and will insistent anyway.
maribu
approved these changes
Apr 29, 2024
Member
|
Would you mind to squash the two commits into one? |
c10c722 to
a813e97
Compare
Contributor
Author
|
Squashed. |
Member
|
Hmm, automerge didn't seem to work here: There is no job running on Murdock. Let's turn it off and on again. |
Member
|
Ahh, my fault 😅 |
Member
|
Thx for your contribution 😄 |
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.
Contribution description
Currently
LEDX_ON,LEDX_OFF, etc. are defined in theboard.h(orboard_common.hor similar) files. However, various boards could have from 0 to 8 internal LEDs and to write portable code each call ofLEDX_...should be protected by#ifdef LEDX_.... Includingled.hheader file resolve this issue and defines emptyLEDX_...if LED is not present for given board. However, after includingled.hthere is no possibility to check if given board, really posses particular LED.This PR adds
LEDX_IS_PRESENTdefine for each presented LED at given board.Testing procedure
This code snippet:
Should show real number of first three LEDs, for example:
in native board.
Issues/PRs references
None