@@ -126,6 +126,10 @@ A general module can be split into two APIs, the frontend (or user API) and the
126
126
- Avoid operations that can fail if you can't signal an error. Class constructors should not fail.
127
127
- Nonrecoverable errors (such as OOM and mutex lock in interrupt) should not return to users.
128
128
- Recoverable errors (such as UDP packet loss) should be propagated to the user via error code.
129
+ - Handle deprecation with care. We do not remove deprecated APIs until the next major OS revision. Reasons for deprecation include:
130
+ - Design pattern traps that cause developers to write incorrect code.
131
+ - Code that is functionally incorrect.
132
+ - Code that is not safe (syncronization) or that results in undefined behavior.
129
133
130
134
##### API design - porting layer
131
135
@@ -159,7 +163,10 @@ A general module can be split into two APIs, the frontend (or user API) and the
159
163
osStatus lock(uint32_t millisec=osWaitForever);
160
164
```
161
165
162
- - The doxygen of each class's header file should contain a simple use example.
166
+ - The doxygen of each class's header file must contain a use example using `@code` and `@endcode`.
167
+ - Each API should also provide an `@code` and `@endcode` section building upon the class header example.
168
+ - If more specific information is needed about a method, this should be accomplished using `@note`.
169
+ - If a method is deprecated, it must use the `@deprecated` tag and include a description of what method to replace it with.
163
170
- Each module should provide a README that documents the module:
164
171
- The README should start with a small paragraph describing the module to users with no prior knowledge.
165
172
- The README should contain a code example showing how to use the module.
0 commit comments