mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-24 04:32:52 +01:00
update examples in doc comments
This commit is contained in:
parent
39c111a59a
commit
59cff5815b
1 changed files with 27 additions and 7 deletions
34
src/lib.rs
34
src/lib.rs
|
@ -14,8 +14,8 @@
|
||||||
//!
|
//!
|
||||||
//! - **Event triggered tasks** as the unit of concurrency.
|
//! - **Event triggered tasks** as the unit of concurrency.
|
||||||
//! - Supports prioritization of tasks and, thus, **preemptive multitasking**.
|
//! - Supports prioritization of tasks and, thus, **preemptive multitasking**.
|
||||||
//! - **Data race free memory sharing** through fine grained *partial* critical
|
//! - **Data race free memory sharing** through fine grained *non global*
|
||||||
//! sections.
|
//! critical sections.
|
||||||
//! - **Deadlock free execution** guaranteed at compile time.
|
//! - **Deadlock free execution** guaranteed at compile time.
|
||||||
//! - **Minimal overhead** as the scheduler has no software component / runtime; the
|
//! - **Minimal overhead** as the scheduler has no software component / runtime; the
|
||||||
//! hardware does all the scheduling.
|
//! hardware does all the scheduling.
|
||||||
|
@ -134,7 +134,11 @@
|
||||||
//!
|
//!
|
||||||
//! // TASKS
|
//! // TASKS
|
||||||
//! tasks!(stm32f30x, {
|
//! tasks!(stm32f30x, {
|
||||||
//! periodic: (Tim7, P1, true),
|
//! periodic: Task {
|
||||||
|
//! interrupt: Tim7,
|
||||||
|
//! priority: P1,
|
||||||
|
//! enabled: true,
|
||||||
|
//! },
|
||||||
//! });
|
//! });
|
||||||
//!
|
//!
|
||||||
//! fn periodic(mut task: Tim7, _priority: P1) {
|
//! fn periodic(mut task: Tim7, _priority: P1) {
|
||||||
|
@ -184,8 +188,16 @@
|
||||||
//! // omitted: `idle`, `init`
|
//! // omitted: `idle`, `init`
|
||||||
//!
|
//!
|
||||||
//! tasks!(stm32f30x, {
|
//! tasks!(stm32f30x, {
|
||||||
//! t1: (Tim6Dacunder, P1, true),
|
//! t1: Task {
|
||||||
//! t2: (Tim7, P1, true),
|
//! interrupt: Tim6Dacunder,
|
||||||
|
//! priority: P1,
|
||||||
|
//! enabled: true,
|
||||||
|
//! },
|
||||||
|
//! t2: Task {
|
||||||
|
//! interrupt: Tim7,
|
||||||
|
//! priority: P1,
|
||||||
|
//! enabled: true,
|
||||||
|
//! },
|
||||||
//! });
|
//! });
|
||||||
//!
|
//!
|
||||||
//! // Data shared between tasks `t1` and `t2`
|
//! // Data shared between tasks `t1` and `t2`
|
||||||
|
@ -243,8 +255,16 @@
|
||||||
//! // omitted: `idle`, `init`
|
//! // omitted: `idle`, `init`
|
||||||
//!
|
//!
|
||||||
//! tasks!(stm32f30x, {
|
//! tasks!(stm32f30x, {
|
||||||
//! t1: (Tim6Dacunder, P1, true),
|
//! t1: Task {
|
||||||
//! t2: (Tim7, P2, true),
|
//! interrupt: Tim6Dacunder,
|
||||||
|
//! priority: P1,
|
||||||
|
//! enabled: true,
|
||||||
|
//! },
|
||||||
|
//! t2: Task {
|
||||||
|
//! interrupt: Tim7,
|
||||||
|
//! priority: P2,
|
||||||
|
//! enabled: true,
|
||||||
|
//! },
|
||||||
//! });
|
//! });
|
||||||
//!
|
//!
|
||||||
//! static COUNTER: Resource<Cell<u32>, C2> = Resource::new(Cell::new(0));
|
//! static COUNTER: Resource<Cell<u32>, C2> = Resource::new(Cell::new(0));
|
||||||
|
|
Loading…
Reference in a new issue