You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/guidelines.md
+6-8Lines changed: 6 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -61,17 +61,15 @@ Exceptions:
61
61
62
62
### Optional features should be documented properly (CC-DOC-OPT-FEATURES)
63
63
64
-
All optional features of `r3` must be listed and explained in the crate-level documentation.
64
+
All optional features of `r3`and `r3_kernel`must be listed and explained in the crate-level documentation.
65
65
66
66
In addition, every public item gated by such features must have [`#[doc(cfg(feature = ...))]` attribute](https://github.com/rust-lang/rust/issues/43781), which displays the required feature on the generated documentation.
67
67
68
68
```rust
69
-
/// Get the current [system time].
70
-
///
71
-
/// [system time]: crate#kernel-timing
69
+
/// Get the current system time.
72
70
#[cfg(feature ="system_time")]
73
71
#[doc(cfg(feature ="system_time"))]
74
-
fntime() ->Result<Time, TimeError>;
72
+
pubfntime() ->Result<Time, TimeError>;
75
73
```
76
74
77
75
## Testing
@@ -107,18 +105,18 @@ The runtime overhead caused by unused features should be minimized or eliminated
107
105
108
106
Example: If no startup hooks are defined, the compiler will simply remove the startup hook initialization loop because it can figure out that `STARTUP_HOOKS` has no elements.
109
107
110
-
- If the usage of such features can be detected statically in a configuration macro (e.g., `r3::build!`), the macro should control the type choices based on that.
108
+
- If the usage of such features can be detected statically in a configuration macro (e.g., `r3_kernel::build!`), the macro should control the type choices based on that.
111
109
112
110
Examples:
113
111
114
112
-`r3_portkit::tickful::TickfulState` (used by timer drivers) chooses the optimal algorithm based on parameters.
115
113
116
114
- Kernel objects are defined statically and their control blocks are stored in static arrays.
117
115
118
-
- If the above options are infeasible, expose either a `CfgBuilder` method or a Cargo feature to let downstream crates and application developers specify whether a feature should be compiled in.
116
+
- If the above options are infeasible, expose either a method in `Cfg` or a Cargo feature to let downstream crates and application developers specify whether a feature should be compiled in.
119
117
120
118
Examples:
121
119
122
120
- The system clock is controlled by `system_time` feature. The system time is tracked by an internal variable that is updated on timer interrupts, and there's no hope of the compiler optimizing this out. It's impossible for `build!` to detect the usage of `System::time()`. The system clock is not tied to any particular kernel objects, so the software components dependent on the system clock might not have a configuration function. On the other hand, Cargo features are designed exactly for this use case.
123
121
124
-
- Application code can change task priorities at runtime. The maximum (lowest) priority affects the size of internal kernel structures, but it's impossible for `build!` to figure that out. Therefore, `CfgBuilder` exposes `num_task_priority_levels` method.
122
+
- Application code can change task priorities at runtime. The maximum (lowest) priority affects the size of internal kernel structures, but it's impossible for `build!` to figure that out. Therefore, `Cfg` exposes `num_task_priority_levels` method.
0 commit comments