Skip to content

[drivers] Update doxygen errors #4111

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

Merged
merged 9 commits into from
Apr 21, 2017
Merged

[drivers] Update doxygen errors #4111

merged 9 commits into from
Apr 21, 2017

Conversation

sg-
Copy link
Contributor

@sg- sg- commented Apr 4, 2017

#Updates doxygen errors in documentation for code in the drivers/ directory.

Notes:
Many more commits coming and still some errors with the way we present MBED_DEPRECATED

C:\dev\mbed-os>doxygen doxyfile-developer
warning: doxygen no longer ships with the FreeSans font.
You may want to clear or change DOT_FONTNAME.
Otherwise you run the risk that the wrong font is being used for dot generated graphs.

Status

READY

sg- and others added 2 commits April 4, 2017 12:40
stop using scope for \addtogroup. It was placing class methods into the
group documentation instead of the class documentation. The new style is
to explicitly tag the class as @InGroup. This new method will allow the
class to be linked in the group page, and the class page will contain
the detailed documentation of the class methods.
@AnotherButler
Copy link
Contributor

@sg- Thanks for the PR.

Also, we recommend our contributors follow Chris Beam’s seven rules of great commit messages to keep the commit history clear. To match this format, please change your PR title to imperative mood ("Updates" to "Update"), and delete the period at the end. Thanks for your contributions.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

Docs !

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 5, 2017

/morph test

@mbed-bot
Copy link

mbed-bot commented Apr 5, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1833

All builds and test passed!

@sg-
Copy link
Contributor Author

sg- commented Apr 6, 2017

@geky is there something we can do to make doxygen and MBED_DEPRECATED play nicely together? This can easily be validated in the online IDE by taking a header and generating docs for it in an example program or library

@geky
Copy link
Contributor

geky commented Apr 6, 2017

I'm not sure there's a "trick" we can do in the source code. The MBED_DEPRECATED also has to be compatible with function and template declarations across the three toolchains.

It does look like there's a config option to skip function-like macros:
https://www.stack.nl/~dimitri/doxygen/manual/config.html#cfg_skip_function_macros

That should take care of most of the attributes in mbed_toolchain.h. I'm guess it's currently off? Not sure how to change the doxygen config.

If that doesn't work there are other doxygen configuration options for specifying macros during doxygen generation, so we may be able to force the MBED_DEPRECATED to expand to nothing.

@pan-
Copy link
Member

pan- commented Apr 6, 2017

@geky If ENABLE_PREPROCESSING is set to YES in the doxy file then the macro MBED_DEPRECATED will be expanded to empty spaces (see). It would also requires to have either:

  • SEARCH_INCLUDES set to yes and INCLUDE_PATH containing the path to mbed_toolchain.h
  • PREDEFINED containing MBED_DEPRECATED dummy macro replacement for doxygen.

@sg-
Copy link
Contributor Author

sg- commented Apr 11, 2017

@geky @pan- Thanks for the suggestions but they didn't seem to work. To be more clear, the problems is not with the macro definition but its use in the headers. https://github.com/ARMmbed/mbed-os/blob/master/drivers/Ticker.h#L90...L93

Best solution I could come up with has been to remove the extra doxygen comment * to exclude the docs or maybe I misinterpreted your suggestions. Here is what I'm trying to remove

image

Given this is for our API documentation I kinda like the idea of removing the extra * from private members too and maybe protected. Anything that you wouldn't expect a developer to be using. The private and protected members should still be documented, just not rendered as part of doxygen.

Thoughts?

@sg- sg- force-pushed the fix-the-docs branch 2 times, most recently from a4d7a89 to 95a5219 Compare April 11, 2017 14:54
@sg-
Copy link
Contributor Author

sg- commented Apr 11, 2017

@AnotherButler thanks for the tip. What do you think about 95a5219

@geky
Copy link
Contributor

geky commented Apr 11, 2017

Oh, that works if we just want to remove the documentation. It seems like a reasonable pragmatic approach to me.

@sg-
Copy link
Contributor Author

sg- commented Apr 11, 2017

We still need a DEPRECIATED section of the API guide but this could be hand coded...

@pan-
Copy link
Member

pan- commented Apr 11, 2017

The private and protected members should still be documented, just not rendered as part of doxygen.

I agree 100%

@geky @pan- Thanks for the suggestions but they didn't seem to work. To be more clear, the problems is not with the macro definition but its use in the headers. https://github.com/ARMmbed/mbed-os/blob/master/drivers/Ticker.h#L90...L93

I guess doxygen is not able to find the correct include and therefore cannot expand the macro.

I obtain the expected result:

doxy_deprecated

With this preprocessor settings:

#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING   = YES
MACRO_EXPANSION        = YES
EXPAND_ONLY_PREDEF     = NO
SEARCH_INCLUDES        = YES
INCLUDE_PATH           = 
INCLUDE_FILE_PATTERNS  = 
PREDEFINED             = "MBED_DEPRECATED_SINCE(f, g)="
EXPAND_AS_DEFINED      = 
SKIP_FUNCTION_MACROS   = NO

Other predefinitions of macros might be required, I didn't run doxygen over the complete mbed tree.

sg- added 2 commits April 12, 2017 08:56
Best way to enable MBED_DEPRICATED APIs to be properly rendered
requires using the doxygen preprocessor. This means all device_has
labels need to also be defined or the default DOXYGEN_ONLY label
applied to the API headers which this commit does. ASYNCH currently
exluded.
attach members not using Callback class are not compatible with
const and volatile types. This was missed when callback was initially
added
@sg- sg- changed the title Updates doxygen errors. [drivers] Updates doxygen errors. Apr 12, 2017

/** Templated Circular buffer class
*
* @Note Synchronization level: Interrupt safe
* @ingroup plaftorm
Copy link
Contributor

Choose a reason for hiding this comment

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

Please change "plaftorm" to "platform"

Copy link
Contributor

Choose a reason for hiding this comment

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

my bad.

@sg-
Copy link
Contributor Author

sg- commented Apr 12, 2017

And this is a test build to track the progress of: https://docs.mbed.com/projects/sam-doxy-test/

All fields are strings, not arrays. Update the PREDEFINED and
EXCLUDE_PATTERNS fields.
@sg-
Copy link
Contributor Author

sg- commented Apr 19, 2017

@tommikas Not sure what happened to pr-head here...

@tommikas
Copy link
Contributor

tommikas commented Apr 19, 2017

The build passed but for some reason the status didn't get updated here. I'll retrigger the job.

@theotherjimmy
Copy link
Contributor

@0xc0170 Both @sg- and me have commits on this one, so you have to merge when you feel ready.

@adbridge
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 52

Test failed!

@bridadan
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 55

Test failed!

@bridadan
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 56

All builds and test passed!

@adbridge adbridge changed the title [drivers] Updates doxygen errors. [drivers] Update doxygen errors Apr 21, 2017
@adbridge adbridge merged commit 47b1a9e into ARMmbed:master Apr 21, 2017
@sg-
Copy link
Contributor Author

sg- commented Apr 21, 2017

Changed release version as this could break existing docs for 5.4 (I think RTOS is still excluded etc.)

@adbridge
Copy link
Contributor

adbridge commented Apr 21, 2017

ooo that change may have come too late, will check if this has already gone into 5.4.4.
Actually looks like it got changed just in time :)

@sg- sg- deleted the fix-the-docs branch April 21, 2017 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants