New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
periph_common: add as dependency to periph drivers #9906
Conversation
e0e3bee
to
122c5ce
Compare
122c5ce
to
f1f7791
Compare
rebased, bc #9905 was merged |
ola, any comments on this generalisation? |
Mabye from @haukepetersen? |
By default it only always adds the definition of In general it makes sense as the dependencies have been implemented using headers macros instead of the build system.
It is there RIOT/cpu/esp8266/Makefile.include Line 122 in e4ca897
periph_init
It is not using |
f1f7791
to
6f906a7
Compare
@cladmi rebase and added comment as suggested |
ping! |
ping again |
6f906a7
to
4e4a7df
Compare
@cladmi what was the problem here, i.e. are any changes required. Do you agree or disagree with making |
It might make more sense to make periph_* depend on periph_common. |
mhm, sounds reasonable, too - my observation/point was that it doesn't make sense to have |
4e4a7df
to
fd8a66a
Compare
@kaspar030 add a fixup with your suggestion, need to reword the commit message when squashing |
Now there might be a problem when no periph_ is actually used, as then theres no periph_init(), but that is hard-called in all architectures. Unfortunately the call cannot easily be moved into e.g., kernel_init(), as some platforms don't call it last in their startup sequence... Maybe that is not a problem. It is not with the current codebase. |
well that hard-coded call of So I would go for this solution, also (thanks to you suggestion to make it a dependency) its much cleaner and more appropriate way to add |
+1, one step at a time. :) |
can/shall I squash? |
yes please. @cladmi wanna take another look? |
fd8a66a
to
8c3e214
Compare
done, ready to merge ... |
Currently it makes that I agree with he given justification in the commit message and the current changes done. However, I think that now there are other places that might need the change too:
|
8c3e214
to
66a2cb1
Compare
@cladmi comments addressed, squash? |
66a2cb1
to
13a6735
Compare
@cladmi how to proceed? Can I squash? |
Please squash, it got lost in my mailbox. |
Rational: the periph_common module is required by (most) other periph drivers and also during startup of the CPU/MCU to run periph_init. The latter is only required if other periph drivers are used, hence periph_common should be a depency of periph_* modules and *not* of the CPU/MCU. This PR fixes that by making periph_common a depency of periph_* and removing the explicit include in the CPU/MCU implementation.
9c9f130
to
2de4b30
Compare
done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK.
Many periphs use the periph_common
implementation without setting the dependency.
Also, even if periph_init
is called by cpu
it makes sense that it is a dependency of periph
anyway.
Forgot in the Approve comment, I checked that the branch rebased on master only had this dependency definition to
|
Contribution description
Rational: the periph_common module is included by each and every CPU/MCU
via one way or the other, hence it can be activated by default. With this
PR its added to the list of default modules.
Actually, the periph_common was missing for CPUs
esp8266
andfe310
which would result in I2C or SPI not working for instance, because they rely on periph auto init by periph_common. This is fixed with this PR implicitly -> but requires #9905.Testing procedure
Issues/PRs references
based on #9905