sys/ztimer: auto_init react to possibly missing ztimer_periph_timer#16342
sys/ztimer: auto_init react to possibly missing ztimer_periph_timer#16342kfessel wants to merge 1 commit intoRIOT-OS:masterfrom
Conversation
e7f2519 to
42ad3b4
Compare
| # define ZTIMER_MSEC_CONVERT_LOWER_FREQ ZTIMER_RTT_FREQ | ||
| # endif | ||
| # else | ||
| # elif defined(ZTIMER_TIMER) |
There was a problem hiding this comment.
I think there should be an #else clause added that gives an #error in cause ztimer_msec is used, but neither the periph_rtt nor the periph_timer backend is selected. This might not be possible to configure, but better be safe than sorry.
There was a problem hiding this comment.
error messages for no Backend selected (e.g.: cause there is non) happen in step 3
| # define INIT_ZTIMER_TIMER 1 | ||
| # endif | ||
| # define ZTIMER_SEC_CONVERT_LOWER_FREQ ZTIMER_TIMER_FREQ | ||
| # endif | ||
| #endif |
There was a problem hiding this comment.
| # define INIT_ZTIMER_TIMER 1 | |
| # endif | |
| # define ZTIMER_SEC_CONVERT_LOWER_FREQ ZTIMER_TIMER_FREQ | |
| # endif | |
| #endif | |
| # define INIT_ZTIMER_TIMER 1 | |
| # endif | |
| # define ZTIMER_SEC_CONVERT_LOWER_FREQ ZTIMER_TIMER_FREQ | |
| # else | |
| # error "No backend available to implement ZTIMER_SEC" | |
| # endif | |
| #endif |
?
There was a problem hiding this comment.
this error message is in l 207 ante commit l 202 post commit
in step 1 a backend is selected (step 1 has all the precedence logic)
if non is (could be) selected a error message is printed in step 3
we can have extra error message in step one but we don't need them there
|
ping @maribu |
|
The code looks good to me. But I guess it's not a bad idea to test this with all combinations. I think I might have some time for that tomorrow |
|
I think #16553 can fix this as well |
#16553 make the problem not appear: The configuration is as it should be, But since the ztimer auto_init is kind of long and errors may show up in lines that may not show the most simple issue that might cause them. It also improves the ZTIMER_SEC/MSEC/USEC similarity which makes it more easy to read. I still would like to see this merged. #16322 would have been easier to solve if this had been in. |
|
#17372 would have been easier to solve if this had been in. |
42ad3b4 to
4598a11
Compare
|
#17654 got this in |
Contribution description
In #16172 I assumed ztimer_periph_timer to always be available (it was always configured in config.h) but some recent PR by @haukepetersen (#16322 identified by @jue89) showed this is no always the case.
This adapts ztimers auto_init.c to that case.
(if somehow ztimer_periph_timer is not included but required an error message will be shown)
Testing procedure
read and tests/ztimer_xsec
Issues/PRs references
#16172