Add multilock to the book

This commit is contained in:
Emil Fresk 2020-11-14 16:09:20 +01:00
parent 243668df54
commit d079949139
2 changed files with 9 additions and 1 deletions

View file

@ -64,6 +64,14 @@ $ cargo run --example lock
{{#include ../../../../ci/expected/lock.run}} {{#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
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. 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.

View file

@ -43,7 +43,7 @@ use cortex_m::{
}; };
use cortex_m_rt as _; // vector table use cortex_m_rt as _; // vector table
pub use cortex_m_rtic_macros::app; 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)] #[cfg(armv7m)]
pub mod cyccnt; pub mod cyccnt;