sys/auto_init: improve documentation#9328
Conversation
sys/include/auto_init.h
Outdated
| * when using auto_init unless you know what you're doing. | ||
| * | ||
| * This feature can be enabled in any application by adding the `auto_init` | ||
| * module to the application `Makefile`: |
sys/include/auto_init.h
Outdated
| * ~~~~~~~~~~~~~~~~~~~~~~~ | ||
| * | ||
| * `auto_init` initializes any included module that provides auto | ||
| * initialization capabilities. |
There was a problem hiding this comment.
Below, you use "auto-initialization" instead of "auto initialization". I prefer the first, but regardless: please be consistent.
sys/include/auto_init.h
Outdated
| * `auto_init` initializes any included module that provides auto | ||
| * initialization capabilities. | ||
| * | ||
| * Drivers or cpu peripherals that provides a SAUL adaption and network |
There was a problem hiding this comment.
Maybe add a @ref here to each of the groups below?
|
@miri64, first batch of comments addressed. I also have other doxygen changes in all drivers that provide saul adaption (but not commited/pushed): in each driver header, I added |
That sounds rather like new PR material ;-). |
| * | ||
| * The default initialization parameters can be overriden by the application in | ||
| * several ways (examples with the @ref drivers_bmp180 oversampling parameter | ||
| * `BMP180_PARAM_OVERSAMPLING`): |
There was a problem hiding this comment.
I think all three paragraphs above should be merged, since they are independent from the very first paragraph, but belong thematically very close together. Also, I think the first one of these three is hard to read in rendered docs, due to using auto-refs. Please consider the following
Device drivers that provides a [SAUL](@ref drivers_saul) adaptation and
[network device drivers](@ref drivers_netdev) can be initialized
automatically using by the `auto_init` module. Their default initialization
parameters need to be in a `DRIVER_params.h` file provided by the driver
implementation. They can be overriden by the application in several ways
(examples below with the @ref drivers_bmp180's oversampling parameter
`BMP180_PARAM_OVERSAMPLING`):| * - by passing them via the `CFLAGS` variable on the build command line`: | ||
| * | ||
| * ``` | ||
| * CFLAGS=-DBMP180_PARAM_OVERSAMPLING=1 USEMODULE=bmp180 make BOARD=arduino-zero -C examples/default |
There was a problem hiding this comment.
For some reason default is bold in the rendered doc. Don't know why though... using ~~~~~~~~~~~~~~~~ {.sh} instead doesn't help :-/.
sys/include/auto_init.h
Outdated
| * - by just setting the `CFLAGS` variable in the application `Makefile`: | ||
| * | ||
| * ~~~~~~~~~~~~~~~~~~~~~~~ {.mk} | ||
| * CFLAGS +=-DBMP180_PARAM_OVERSAMPLING=1 |
sys/include/auto_init.h
Outdated
| * several ways (examples with the @ref drivers_bmp180 oversampling parameter | ||
| * `BMP180_PARAM_OVERSAMPLING`): | ||
| * | ||
| * - by passing them via the `CFLAGS` variable on the build command line`: |
sys/include/auto_init.h
Outdated
| * CFLAGS=-DBMP180_PARAM_OVERSAMPLING=1 USEMODULE=bmp180 make BOARD=arduino-zero -C examples/default | ||
| * ``` | ||
| * | ||
| * - by just setting the `CFLAGS` variable in the application `Makefile`: |
There was a problem hiding this comment.
Remove "just" here. It doesn't fit in the middle of the enumeration.
sys/include/auto_init.h
Outdated
| * ~~~~~~~~~~~~~~~~~~~~~~~ | ||
| * | ||
| * - by copying the `bmp180_params.h` header to the application directory and | ||
| * editing it there with the desired values (not recommended). This file will |
There was a problem hiding this comment.
Since when is this not recommended? It's the only way to do it if you add additional external devices (say e.g. a samr21-xpro with an Openlabs connected).
| * USEMODULE in the application's Makefile. auto_init will initialize | ||
| * any other included module that does not require a parameter in | ||
| * its init function, i.e. if the prototype looks like this: void | ||
| * MODULE_init(void). Most timer modules or simple drivers can be |
There was a problem hiding this comment.
This whole section about the format of the prototype disappears, but is as important as the parameterization of complex drivers added below. It should go before that.
sys/include/auto_init.h
Outdated
| * | ||
| * - by copying the `bmp180_params.h` header to the application directory and | ||
| * editing it there with the desired values (not recommended). This file will | ||
| * be included first and, thanks to header guards, the one from the driver |
There was a problem hiding this comment.
The half-sentence about header guards sounds clunky. Remove?
afd346c to
2da81e8
Compare
|
@miri64, I reworked the documentation. |
see #9337 |
|
@miri64, I think your comments are addressed here. May I squash ? |
2da81e8 to
741c8c0
Compare
|
@miri64, squashed. |
|
All green there, so I think I can merge. |
Contribution description
This PR is a follow-up of #9264 and fixes #7001. It's not adding a new dedicated markdown page but just improving the actual
auto_initmodule doxygen documentation.Issues/PRs references
fixes #7001, related to #9264