aboutsummaryrefslogtreecommitdiff
path: root/book/en/src/by-example/tips_static_lifetimes.md
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-03-04 21:10:24 +0000
committerGitHub <noreply@github.com>2023-03-04 21:10:24 +0000
commit7c7d6558f6d9c50fbb4d2487c98c9a5be15f2f7b (patch)
tree80a47f0dc40059014e9448c4c2eb34c54dff45fe /book/en/src/by-example/tips_static_lifetimes.md
parent1c5db277e4161470136dbd2a11e914ff1d383581 (diff)
parent98c5490d94950608d31cd5ad9dd260f2f853735c (diff)
Merge #694
694: RTIC 2 r=AfoHT a=korken89 Co-authored-by: Emil Fresk <emil.fresk@gmail.com> Co-authored-by: Per Lindgren <per.lindgren@ltu.se>
Diffstat (limited to 'book/en/src/by-example/tips_static_lifetimes.md')
-rw-r--r--book/en/src/by-example/tips_static_lifetimes.md15
1 files changed, 7 insertions, 8 deletions
diff --git a/book/en/src/by-example/tips_static_lifetimes.md b/book/en/src/by-example/tips_static_lifetimes.md
index dadd9c9..0eaa59f 100644
--- a/book/en/src/by-example/tips_static_lifetimes.md
+++ b/book/en/src/by-example/tips_static_lifetimes.md
@@ -2,23 +2,22 @@
In `#[init]` and `#[idle]` `local` resources have `'static` lifetime.
-Useful when pre-allocating and/or splitting resources between tasks, drivers
-or some other object.
-This comes in handy when drivers, such as USB drivers, need to allocate memory and
-when using splittable data structures such as [`heapless::spsc::Queue`].
+Useful when pre-allocating and/or splitting resources between tasks, drivers or some other object. This comes in handy when drivers, such as USB drivers, need to allocate memory and when using splittable data structures such as [`heapless::spsc::Queue`].
-In the following example two different tasks share a [`heapless::spsc::Queue`]
-for lock-free access to the shared queue.
+In the following example two different tasks share a [`heapless::spsc::Queue`] for lock-free access to the shared queue.
[`heapless::spsc::Queue`]: https://docs.rs/heapless/0.7.5/heapless/spsc/struct.Queue.html
``` rust
-{{#include ../../../../examples/static.rs}}
+{{#include ../../../../rtic/examples/static.rs}}
```
Running this program produces the expected output.
``` console
$ cargo run --target thumbv7m-none-eabi --example static
-{{#include ../../../../ci/expected/static.run}}
+```
+
+``` console
+{{#include ../../../../rtic/ci/expected/static.run}}
```