sys/ztimer: add 'ztimer_no_periph_rtt#17099
sys/ztimer: add 'ztimer_no_periph_rtt#17099fjmolinas wants to merge 3 commits intoRIOT-OS:masterfrom
Conversation
|
Why not just remove the automatic rtt rtc selection from makefile.dep? periph_rtt is no good indicator for an rtt being able to power msec why did this change get merged with an KConfig PR #16909? just revert 34259e1 and remove the |
Why not?
There isl
You are surely right about that, I should have asked for a split, at the time I though it was an issue with the Makefile not being inline with Kconfig, but thas was my bad.
I won't revert the change in |
sys/include/ztimer.h
Outdated
| * | ||
| * If `periph_rtt` or `periph_rtc` is required with direct access by another | ||
| * MODULE or an application, `ztimer_no_periph_rtt` or `ztimer_no_periph_rtc` | ||
| * can be included to avoid automatic selection of either `ztimer_periph_rtc` |
There was a problem hiding this comment.
| * can be included to avoid automatic selection of either `ztimer_periph_rtc` | |
| * must be included to avoid automatic selection of either `ztimer_periph_rtc` |
There was a problem hiding this comment.
i think there should also be a warning and link int the periph_rtt documentation about that automatic rtt selection of ztimer
|
@benpicco also mentione that a build-system warning would be desirable, I'll take another look on the next sprint |
f2419c3 to
acc1b8e
Compare
|
The |
No, this is not the case. Rember that |
kfessel
left a comment
There was a problem hiding this comment.
no need for sys/ztimer/Makefile.ztimer.rtt.dep
bda703d to
abb6c1e
Compare
kfessel
left a comment
There was a problem hiding this comment.
one (two) minor static-test-failures.
|
I'll squash if static tests pass. |
a85a19c to
b35229c
Compare
sys/ztimer/Makefile.dep
Outdated
|
|
||
| # If ztimer is used enable rtt autoselection for ztimer_msec, and ztimer_sec. | ||
| # This will enable inclusion of `ztimer_periph_rtt` if `periph_rtt` is supported. | ||
| DEFAULT_MODULE += ztimer_periph_rtt_auto_select |
There was a problem hiding this comment.
this line is not yet evaluated when l 96 is reached -> no auto selection is done
sys/ztimer/Makefile.dep
Outdated
|
|
||
| # If ztimer is used enable rtt autoselection for ztimer_msec, and ztimer_sec. | ||
| # This will enable inclusion of `ztimer_periph_rtt` if `periph_rtt` is supported. | ||
| DEFAULT_MODULE += ztimer_periph_rtt_auto_select |
There was a problem hiding this comment.
Ajj true, that is why initially I had put in Makefile.default..., couldn't remember why and moved it out :/
There was a problem hiding this comment.
I can't think of another solution than ae0bf90... it does mean that a ztimer module will show up even when ztimer is not used...
There was a problem hiding this comment.
make -C examples/hello-world/ clean info-modules
auto_init
board
core
core_idle_thread
core_init
core_msg
core_panic
cpu
native_drivers
periph
periph_common
periph_gpio
periph_gpio_linux
periph_init
periph_init_gpio
periph_init_gpio_linux
periph_init_pm
periph_init_uart
periph_pm
periph_uart
stdio_native
sys
ztimer_periph_rtt_auto_select
11deff0 to
860addb
Compare
|
Rebased because of conflict with master |
| * If `periph_rtt` or is required with direct access by another MODULE or | ||
| * application, `ztimer_periph_rtt_auto_select` can be disabled to avoid automatic | ||
| * selection of `ztimer_periph_rtt` as a backend for ZTIMER_SEC and ZTIMER_MSEC. | ||
| * i.e.: `DISABLE_MODULE += ztimer_periph_rtt_auto_select`. |
There was a problem hiding this comment.
Could we maybe invert the logic? Making a module that avoids the default selection if present in the application makefile? then we wouldn't have the issue of the default module always showing up, right?
There was a problem hiding this comment.
That was the initial approach I had, I can go back to that.
There was a problem hiding this comment.
i think the was a problem that lead to abondoning that approach (like could not be kconfig model???)
There was a problem hiding this comment.
I split into an alternative the old versio so its easier to compare #17284
There was a problem hiding this comment.
@leandrolanzieri @kfessel opinion on what option to prefer this one or #17284?
There was a problem hiding this comment.
Please Squash and activate ci:ready..
tested with make configuration (using test/ztimer_xsec) ✔️
I also tested with kconfig ✔️
and squash right in:
while reviewing these line threw me in the wrong way would you please remove the S in the make variables (even though these lines are not part of this PR)
sys/ztimer/Makefile.dep
12: # but RIOT's auto_init scheme expects "auto_init_ztimer" in DEFAULT_MODULES so
13: # it can be disabled (by adding to DISABLE_MODULES).
please change to
DEFAULT_MODULE
DISABLE_MODULE
sys/include/ztimer.h
Outdated
| * if if these are missing it will use same basic timer | ||
| * as ZTIMER_USEC does. | ||
| * | ||
| * If `periph_rtt` or is required with direct access by another MODULE or |
There was a problem hiding this comment.
| * If `periph_rtt` or is required with direct access by another MODULE or | |
| * If `periph_rtt` is required with direct access by another MODULE or |
This was removed in another PR. |
This is a temporary fix for Issue RIOT-OS#17060. It adds a module that enables the auto-inclusion of 'ztimer_periph_rtt'. This module, 'ztimer_periph_rtt_auto_select' is set as a DEFAULT_MODULE and can therefore be deselect at application level of in CPU/BOARDs 'Makefile.default'. Limitations: - This does not allow for modules to disable the auto-selection, e.g.: there can't be a depency where 'rtt_rtc' disables 'ztimer_periph_rtt_auto_select' - This does not disallow direct inclusions of `ztimer_periph_rt*`, since this only disables auto inclusion of these modules This is a temporary solution since this is already possible with Kconfig, but not in make.
860addb to
08d5b9e
Compare
|
Superseeded by #17284 |
Contribution description
This is a temporary fix for Issue #17060. It allows disabling
auto inclusion of
ztimer_periph_rt*in cases where anothermodule or application requires direct access.
Limitations:
these modules should be included early in the build at the application
level and not in modules
Makefile.depztimer_periph_rt*,since this only disables auto inclusion of these modules
This is a temporary solution since this is already possible with
Kconfig, but not in make.
This implements the easiest fix proposed in #17060 to be able to move forward with the migration.
Testing procedure
Issues/PRs references
#17060