sys/board_common: add generic board_init() function#17008
sys/board_common: add generic board_init() function#17008fjmolinas merged 4 commits intoRIOT-OS:masterfrom
Conversation
526e81d to
042836f
Compare
042836f to
4dd0089
Compare
| gpio_init(LED##x##_PIN, GPIO_OUT); \ | ||
| LED##x##_OFF; \ | ||
| } while (0) | ||
|
|
There was a problem hiding this comment.
I think that drivers/include/led.h can be useful, as it e.g. already has a function like macro LED_OFF(x) and empty fallbacks for non-existing LEDs from 0 to 7.
There was a problem hiding this comment.
Sure can do - but that would not help me with the gpio_init()
drivers/include/disp_dev.h
Outdated
| #ifdef LCD_BACKLIGHT | ||
| gpio_init(LCD_BACKLIGHT, GPIO_OUT); | ||
| #endif |
There was a problem hiding this comment.
Do we really need to init this GPIO everytime we want to turn on a backlight ?
There was a problem hiding this comment.
And why only a single backlight if we can have multiple displays?
This should be moved to a separate PR, I just wanted to get this past CI.
|
ping |
| #endif | ||
| #ifdef LED7_PIN | ||
| LED_INIT(7); | ||
| #endif |
There was a problem hiding this comment.
Thinking about it, maybe this should better be moved to an auto_init_leds module
fjmolinas
left a comment
There was a problem hiding this comment.
ACK on my side let's wait and see if anyone has comments and merge this.
|
Shouldn't we adapt documentation accordingly? It currently states:
|
4e07418 to
35ecfad
Compare
bf30671 to
859d386
Compare
859d386 to
48088cb
Compare
|
Hmm I see you also went for #16013, I think that the last commit was a bit too greedy to do in this one, now there is the question if "kernel_init.h" is the right place for the definition, here it just seems like it was used as a header that is known to be included everywhere. |
|
Oh I just thought that if I can drop the commit if you prefer that. |
|
What would be a better place for it? |
48088cb to
35ecfad
Compare
|
I dropped 48088cb for now. |
I don't know... but everything that touches core is a sensible spot, which is why I would rather avoid it from this PR :) |
Contribution description
Usually
board_init()will just initialize the on-board LEDs.This PR provides a generic, weak
board_init()function that can be used as a fall-back if the board does not define a customboard_init()I also dropped the trivial
board_init()functions from a few boards as an example.Testing procedure
examples/blinkystill works as expected.Issues/PRs references