diff options
| author | Emil Fresk <emil.fresk@gmail.com> | 2020-11-14 16:09:20 +0100 |
|---|---|---|
| committer | Emil Fresk <emil.fresk@gmail.com> | 2020-11-14 16:13:00 +0100 |
| commit | d079949139b9d4d5280a08143edc1d717d5c5b52 (patch) | |
| tree | 28e6aa0d8827039f2d98ff251145befb60ab9b2d | |
| parent | 243668df5424e047dbfe8c4151eef5c7ebc88dc1 (diff) | |
Add multilock to the book
| -rw-r--r-- | book/en/src/by-example/resources.md | 8 | ||||
| -rw-r--r-- | src/lib.rs | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/book/en/src/by-example/resources.md b/book/en/src/by-example/resources.md index 301961d..3a3e0b7 100644 --- a/book/en/src/by-example/resources.md +++ b/book/en/src/by-example/resources.md @@ -64,6 +64,14 @@ $ cargo run --example lock {{#include ../../../../ci/expected/lock.run}} ``` +## Multi-lock + +As an extension to `lock`, and to reduce rightward drift, locks can be taken as tuples. The following examples shows this in use: + +``` rust +{{#include ../../../../examples/multilock.rs}} +``` + ## Late resources Late resources are resources that are not given an initial value at compile time using the `#[init]` attribute but instead are initialized at runtime using the `init::LateResources` values returned by the `init` function. @@ -43,7 +43,7 @@ use cortex_m::{ }; use cortex_m_rt as _; // vector table pub use cortex_m_rtic_macros::app; -pub use rtic_core::{Exclusive, Mutex, prelude as mutex_prelude}; +pub use rtic_core::{prelude as mutex_prelude, Exclusive, Mutex}; #[cfg(armv7m)] pub mod cyccnt; |
