-
Notifications
You must be signed in to change notification settings - Fork 8.3k
led: add a struct led_dt_spec and some _dt wrapper APIs #81248
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
Conversation
34cf771 to
619dcc3
Compare
619dcc3 to
7e42b84
Compare
gmarull
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.
minor docs nit, otherwise lgtm
7e42b84 to
837b7c5
Compare
simonguinot
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.
Hi @fabiobaltieri,
Thanks for this nice addition to the LED API.
Please can you document it in the release-notes file ?
Just out of curiosity, are there any other additions coming?
See my only comment / question, below.
43af1d4
43af1d4 to
76c31dd
Compare
Nope, this is it, just a oneoff. |
simonguinot
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.
Please, add this new API in the release-notes file.
Add a struct led_dt_spec to hold an LED device and index pointer, some initializer and wrapper APIs. This allows simpler LED usage, such as: static const struct led_dt_spec led = LED_DT_SPEC_GET(DT_NODELABEL(led0)); led_on_dt(&led); led_off_dt(&led); Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
76c31dd to
c41baf9
Compare
Sorry, short attention span... added one line with a reference to the struct, that should refer the macros and everything else. |
simonguinot
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.
Thanks !
henrikbrixandersen
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 looks great, thanks. It would be good to have some in-tree users of this and some tests for the added macros.
Add a struct led_dt_spec to hold an LED device and index pointer, some initializer and wrapper APIs.
This allows simpler LED usage, such as: