drivers/periph_common: add periph_init_buttons to init on-board buttons#17711
drivers/periph_common: add periph_init_buttons to init on-board buttons#17711fjmolinas merged 3 commits intoRIOT-OS:masterfrom
Conversation
fjmolinas
left a comment
There was a problem hiding this comment.
LGTM, how about adding it by default to those BOARDS that were initializing buttons? That way there is no change for any user relying on that? (it also adds a compile test for the module)
I don't know, most of those will be just copy & paste without any deeper meaning. If this really breaks something, I hope people will notice 😉 |
cab49bc to
8c78575
Compare
tests/button_led/main.c
Outdated
| * @} | ||
| */ | ||
|
|
||
| #include "board.h" |
There was a problem hiding this comment.
Why add this test? there is already a tests/leds and tests/buttons.
There was a problem hiding this comment.
I don't this test is needed, better adapt the already present tests no?
There was a problem hiding this comment.
Ok, I added it to tests/leds
There was a problem hiding this comment.
Can you extended the README accordingly?|
8c78575 to
e8bd56a
Compare
e8bd56a to
8da2e10
Compare
Contribution description
This adds a
periph_init_buttonsmodule analogous to theperiph_init_leds.However, unlike the LED module, this is not a
DEFAULT_MODULEas most applications that make use of the button will take care of initializing it themselves (e.g. as an interrupt).There is also no consistency with only a few boards auto-initializing the button.
Now with the new module, applications that rely on button auto-init can request it reliably.
Testing procedure
There is no in-tree code that makes use of this feature.
But in it's simplest form, this can be tested with
with
USEMODULE += periph_init_buttonsIssues/PRs references
similar to #17584