Skip to content

sys/auto_init: improve documentation#9328

Merged
aabadie merged 1 commit intoRIOT-OS:masterfrom
aabadie:pr/sys/auto_init_doc_enh
Jun 19, 2018
Merged

sys/auto_init: improve documentation#9328
aabadie merged 1 commit intoRIOT-OS:masterfrom
aabadie:pr/sys/auto_init_doc_enh

Conversation

@aabadie
Copy link
Copy Markdown
Contributor

@aabadie aabadie commented Jun 12, 2018

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_init module doxygen documentation.

Issues/PRs references

fixes #7001, related to #9264

@aabadie aabadie added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: doc Area: Documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jun 12, 2018
@aabadie aabadie requested a review from miri64 June 12, 2018 07:08
* 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`:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to the application's Makefile"

* ~~~~~~~~~~~~~~~~~~~~~~~
*
* `auto_init` initializes any included module that provides auto
* initialization capabilities.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below, you use "auto-initialization" instead of "auto initialization". I prefer the first, but regardless: please be consistent.

* `auto_init` initializes any included module that provides auto
* initialization capabilities.
*
* Drivers or cpu peripherals that provides a SAUL adaption and network
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a @ref here to each of the groups below?

@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Jun 12, 2018

@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 @ingroup drivers_saul and a line mentioning the drivers provides saul capabilities. This way, all drivers with saul support are listed in the SAUL documentation page. Do you think it's worth and it can be added to this PR ?

@miri64
Copy link
Copy Markdown
Member

miri64 commented Jun 12, 2018

Do you think it's worth and it can be added to this PR ?

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`):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason default is bold in the rendered doc. Don't know why though... using ~~~~~~~~~~~~~~~~ {.sh} instead doesn't help :-/.

* - by just setting the `CFLAGS` variable in the application `Makefile`:
*
* ~~~~~~~~~~~~~~~~~~~~~~~ {.mk}
* CFLAGS +=-DBMP180_PARAM_OVERSAMPLING=1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space messing between = and -

* 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`:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stray ` at end of line

* CFLAGS=-DBMP180_PARAM_OVERSAMPLING=1 USEMODULE=bmp180 make BOARD=arduino-zero -C examples/default
* ```
*
* - by just setting the `CFLAGS` variable in the application `Makefile`:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove "just" here. It doesn't fit in the middle of the enumeration.

* ~~~~~~~~~~~~~~~~~~~~~~~
*
* - by copying the `bmp180_params.h` header to the application directory and
* editing it there with the desired values (not recommended). This file will
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

*
* - 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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The half-sentence about header guards sounds clunky. Remove?

@aabadie aabadie force-pushed the pr/sys/auto_init_doc_enh branch from afd346c to 2da81e8 Compare June 12, 2018 19:28
@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Jun 12, 2018

@miri64, I reworked the documentation.

@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Jun 13, 2018

That sounds rather like new PR material ;-).

see #9337

@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Jun 18, 2018

@miri64, I think your comments are addressed here. May I squash ?

Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please squash.

@aabadie aabadie force-pushed the pr/sys/auto_init_doc_enh branch from 2da81e8 to 741c8c0 Compare June 18, 2018 11:59
@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Jun 18, 2018

@miri64, squashed.

@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Jun 19, 2018

All green there, so I think I can merge.

@aabadie aabadie merged commit d49e0d2 into RIOT-OS:master Jun 19, 2018
@cladmi cladmi added this to the Release 2018.07 milestone Jul 10, 2018
@aabadie aabadie deleted the pr/sys/auto_init_doc_enh branch September 23, 2018 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: doc Area: Documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better document how to use devices that support auto_init

3 participants