aboutsummaryrefslogtreecommitdiff
path: root/book/en/src/by-example/tips.md
diff options
context:
space:
mode:
authorEmil Fresk <emil.fresk@gmail.com>2020-10-05 18:25:15 +0200
committerEmil Fresk <emil.fresk@gmail.com>2020-10-05 18:25:15 +0200
commiteec0908024d9b4127ed496b4781adc08000cc2c2 (patch)
treef128b3d91ea4ac0f171ab334d4517552a6803d01 /book/en/src/by-example/tips.md
parent9d2598dc071882a94b813ab1d9ddf49092546257 (diff)
parentf493f21359ccb3ab4643d9470f3581532f47593a (diff)
Merge branch 'master' into always_late_resources
Diffstat (limited to 'book/en/src/by-example/tips.md')
-rw-r--r--book/en/src/by-example/tips.md16
1 files changed, 10 insertions, 6 deletions
diff --git a/book/en/src/by-example/tips.md b/book/en/src/by-example/tips.md
index b191b9d..d8264c9 100644
--- a/book/en/src/by-example/tips.md
+++ b/book/en/src/by-example/tips.md
@@ -24,7 +24,8 @@ Here's one such example:
``` console
$ cargo run --example generics
-{{#include ../../../../ci/expected/generics.run}}```
+{{#include ../../../../ci/expected/generics.run}}
+```
Using generics also lets you change the static priorities of tasks during
development without having to rewrite a bunch code every time.
@@ -47,7 +48,8 @@ the program has been compiled using the `dev` profile.
$ cargo run --example cfg --release
$ cargo run --example cfg
-{{#include ../../../../ci/expected/cfg.run}}```
+{{#include ../../../../ci/expected/cfg.run}}
+```
## Running tasks from RAM
@@ -78,7 +80,8 @@ Running this program produces the expected output.
``` console
$ cargo run --example ramfunc
-{{#include ../../../../ci/expected/ramfunc.run}}```
+{{#include ../../../../ci/expected/ramfunc.run}}
+```
One can look at the output of `cargo-nm` to confirm that `bar` ended in RAM
(`0x2000_0000`), whereas `foo` ended in Flash (`0x0000_0000`).
@@ -115,7 +118,8 @@ Here's an example where `heapless::Pool` is used to "box" buffers of 128 bytes.
```
``` console
$ cargo run --example pool
-{{#include ../../../../ci/expected/pool.run}}```
+{{#include ../../../../ci/expected/pool.run}}
+```
## Inspecting the expanded code
@@ -139,7 +143,7 @@ $ tail target/rtic-expansion.rs
``` rust
#[doc = r" Implementation details"]
-const APP: () = {
+mod app {
#[doc = r" Always include the device crate which contains the vector table"]
use lm3s6965 as _;
#[no_mangle]
@@ -152,7 +156,7 @@ const APP: () = {
rtic::export::wfi()
}
}
-};
+}
```
Or, you can use the [`cargo-expand`] sub-command. This sub-command will expand