boards: re-work LED handling#7350
Conversation
|
I pretty much like that 👍 I volunteer to adapt further boards, will test soon! |
|
btw. regarding the sizes: with my approach in #7321 I also observed an increase (>100B) in size for some boards (samr21-xpro and PhyNode) while others exhibit a rather large decrease (remote-revb) ... |
|
Nice to hear you like it! But before spending any more work on this, we should reach a common understanding about removing the old LED macros first... Maybe it makes sense to post that discussion on the devel list?! |
|
we could also keep but redirect them to the new handlers? I mean, contrary to SPI rework this not direct replacement. |
|
and mark their usage as deprecated and remove them in release 2018.01 (or so) |
|
and yes, we should announce this on devel-list to get more attention - not everyone follows all the github noise. |
|
Replacing the old defines gracefully makes sense. I think the key her is, that the new LED handling adds some (small) function call overhead when cotrolling the LEDs, which is a problem when using the LED pins for timing measurements etc. But if we decide this is ok, I think it would be a quick thing to adapt all boards to this PR. |
|
as I already stated in #7321 I see the benefit in a very much simplified board configuration, as we basically get rid of all the defines for ON/OFF/TOGGLE macros - further, we get a proper API, which is one of RIOTs core idea (features). This certainly adds on size, but as it is a module every one is free to add it or not. Regarding the timing stuff, I've to admit I'm not much into that right now, but sounds like its rather a test case not a something for production? |
| gpio_init(LED5_PIN, GPIO_OUT); | ||
| gpio_init(LED6_PIN, GPIO_OUT); | ||
| gpio_init(LED7_PIN, GPIO_OUT); | ||
| onboard_led_init(); |
There was a problem hiding this comment.
should be guarded with #ifdef MODULE_ONBOARD_LED
| export CPU_MODEL = stm32f303vc | ||
|
|
||
| # use on-board LEDs | ||
| USEMODULE += onboard_led |
There was a problem hiding this comment.
I'm unsure if we really want to make it a default per board, or rather let the developer decide on a per app/tests usage?
There was a problem hiding this comment.
true. I guess it does indeed make sense to only pull the module if needed.
Further thought: we could also move the call to onboard_led_init from the board initialization into the cpu arch initialization, e.g. the reset_handler_default for all cortexm based boards...
|
I am also not very happy with the name of the module, isn't a simple |
|
I did not have time to look at the code, but I think the module may be better named simply |
|
Regarding the naming, IMHO against plain and simple |
|
oh by the way, when introducing this module we can also have the LED automatically exported via SAUL without having to define the SAUL gpio config for the LEDs manually anymore... |
|
how do we proceed here? I still like this 😉 |
|
me too. As there was not response on the mailing list when I put this topic out, I guess most people don't have a strong opinion. When I understood @OlegHahm's reply correctly, then he doesn't mind to go ahead if we provide a similar alternative. So I propose we focus on #7352 first (as this provides this alternative), and once merged we get this PR on the road. |
fine by me, looks small & simple - maybe something for tomorrows HnA |
|
yes, thats what I wanted to hear :-) |
|
Any progress on this ? |
|
There was no progress since one year which leads me to the conclusion that there's no explicit interest in this. Personally I think it's a nice approach, though I don't really see the need. People seem to be happy with our simple LED macros. Furthermore, code size of the test application is not critical IMO. It's just a wild guess but probably there 'll be no efforts to adapt all platforms next to I2C rework and whatever goes on, so I'm closing this one with memo label set. @haukepetersen if you wanna reactivate and convince the community I'm willing to help anyway. |
|
nope, just never found the time :-) |
|
@haukepetersen what is you status on this one? Still working on it? |
WIP/RFC
I quickly played around a bit when thinking about #7321... Comments welcome!
So far only adapted
samr21-xproandstm32f3discovery.Code size for
tests/leds:stm32f3discovery(8 LEDs) - before 8692, after: 8200 -> saves 492 byte'samr21-xpro` (1 LED) - before 7860, after: 7960 -> adds 100 byte
Code size for
hello-world:stm32f3discovery(8 LEDs) - before 9036, after: 9040 -> adds 4 byte'samr21-xpro` (1 LED) - before 8620, after: 8672 -> adds 52 byte
I am not sure, but it seems to me, that the sam is not inlining correctly, need to investigate...