02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

9<br />

Documentation <strong>Guide</strong>lines<br />

INCLUDE FILES Section<br />

Every library and driver entry should have a subheading INCLUDE FILES, which<br />

lists any relevant header files, for example:<br />

RETURNS Section<br />

INCLUDE FILES: sysLib.h<br />

The RETURNS section should be the last section before the SEE ALSO section.<br />

■<br />

Include a RETURNS section in all subroutines. If there is no return value (as in<br />

the case of a void) simply enter:<br />

■<br />

■<br />

■<br />

■<br />

■<br />

RETURNS: N/A<br />

Mention only true returns in the RETURNS section—not values copied to a<br />

buffer given as an argument.<br />

Always start a return-value statement with a capital and end it with a period;<br />

and again, do not use abbreviated English. For example:<br />

RETURNS: The address of the top of memory.<br />

Despite the general rule of style, we do not treat return values as complete<br />

sentences; the subject and verb are understood.<br />

Keep return statements in present tense. (Even if the conditions that cause an<br />

ERROR may be thought of as “past” once ERROR is returned.)<br />

In STATUS returns, ERROR must be followed by a qualifying statement.<br />

Always enter a comma after OK, because it must be clear that the qualifier<br />

belongs to the ERROR condition and not the OK. For example:<br />

RETURNS: OK, or ERROR if memory is insufficient.<br />

Do not preface lines of text with extra leading spaces—input lines whose first<br />

characters is a space cause a fill break. In the past, some authors applied this<br />

technique in RETURNS sections to force line breaks for separate elements of a<br />

return—we do not follow this convention. For example:<br />

CORRECT:<br />

* RETURNS: OK, or ERROR if the tick rate is invalid or the timer<br />

* cannot be set.<br />

9<br />

185

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!