aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Henrik Tjäder <henrik@tjaders.com> 2020-10-12 08:06:37 +0000
committerGravatar Henrik Tjäder <henrik@tjaders.com> 2020-10-12 08:06:37 +0000
commit458db0b73742da0250d119a37341e7d321cbb8b5 (patch)
treed79adc3632343d7f9918c54c7a397d7e8b72eddb
parent32c5a8f213fe69e0b58a08e73885b15ccd220c9a (diff)
downloadrtic-release/v0.4.tar.gz
rtic-release/v0.4.tar.zst
rtic-release/v0.4.zip
Markdown end of fenced code should be on a separate linerelease/v0.4
Done with sd -f c '}}' SUMMARY.md by-example/app.md by-example/new.md by-example/resources.md by-example/singletons.md by-example/tasks.md by-example/timer-queue.md by-example/tips.md by-example/types-send-sync.md by-example.md internals/ceilings.md internals/tasks.md internals/timer-queue.md internals.md preface.md
-rw-r--r--book/en/src/by-example/app.md9
-rw-r--r--book/en/src/by-example/new.md3
-rw-r--r--book/en/src/by-example/resources.md12
-rw-r--r--book/en/src/by-example/singletons.md3
-rw-r--r--book/en/src/by-example/tasks.md9
-rw-r--r--book/en/src/by-example/tips.md18
6 files changed, 36 insertions, 18 deletions
diff --git a/book/en/src/by-example/app.md b/book/en/src/by-example/app.md
index 996b8c16..ff313510 100644
--- a/book/en/src/by-example/app.md
+++ b/book/en/src/by-example/app.md
@@ -55,7 +55,8 @@ process.
``` console
$ cargo run --example init
-{{#include ../../../../ci/expected/init.run}}```
+{{#include ../../../../ci/expected/init.run}}
+```
## `idle`
@@ -83,7 +84,8 @@ The example below shows that `idle` runs after `init`.
``` console
$ cargo run --example idle
-{{#include ../../../../ci/expected/idle.run}}```
+{{#include ../../../../ci/expected/idle.run}}
+```
## `interrupt` / `exception`
@@ -98,7 +100,8 @@ and exception handlers. In RTFM, we refer to interrupt and exception handlers as
``` console
$ cargo run --example interrupt
-{{#include ../../../../ci/expected/interrupt.run}}```
+{{#include ../../../../ci/expected/interrupt.run}}
+```
So far all the RTFM applications we have seen look no different that the
applications one can write using only the `cortex-m-rt` crate. In the next
diff --git a/book/en/src/by-example/new.md b/book/en/src/by-example/new.md
index ae49ef21..855771fb 100644
--- a/book/en/src/by-example/new.md
+++ b/book/en/src/by-example/new.md
@@ -64,4 +64,5 @@ $ cargo add panic-semihosting
``` console
$ # NOTE: I have uncommented the `runner` option in `.cargo/config`
$ cargo run
-{{#include ../../../../ci/expected/init.run}}```
+{{#include ../../../../ci/expected/init.run}}
+```
diff --git a/book/en/src/by-example/resources.md b/book/en/src/by-example/resources.md
index 17f4d139..5c1ddf0e 100644
--- a/book/en/src/by-example/resources.md
+++ b/book/en/src/by-example/resources.md
@@ -24,7 +24,8 @@ two handlers.
``` console
$ cargo run --example resource
-{{#include ../../../../ci/expected/resource.run}}```
+{{#include ../../../../ci/expected/resource.run}}
+```
## Priorities
@@ -67,7 +68,8 @@ the critical section created by the lowest priority handler.
``` console
$ cargo run --example lock
-{{#include ../../../../ci/expected/lock.run}}```
+{{#include ../../../../ci/expected/lock.run}}
+```
One more note about priorities: choosing a priority higher than what the device
supports (that is `1 << NVIC_PRIO_BITS`) will result in a compile error. Due to
@@ -103,7 +105,8 @@ the consumer resource.
``` console
$ cargo run --example late
-{{#include ../../../../ci/expected/late.run}}```
+{{#include ../../../../ci/expected/late.run}}
+```
## `static` resources
@@ -123,4 +126,5 @@ two tasks that run at different priorities.
``` console
$ cargo run --example static
-{{#include ../../../../ci/expected/static.run}}```
+{{#include ../../../../ci/expected/static.run}}
+```
diff --git a/book/en/src/by-example/singletons.md b/book/en/src/by-example/singletons.md
index 0823f057..a29ce990 100644
--- a/book/en/src/by-example/singletons.md
+++ b/book/en/src/by-example/singletons.md
@@ -23,4 +23,5 @@ the [`alloc-singleton`] abstractions.
``` console
$ cargo run --example singleton
-{{#include ../../../../ci/expected/singleton.run}}```
+{{#include ../../../../ci/expected/singleton.run}}
+```
diff --git a/book/en/src/by-example/tasks.md b/book/en/src/by-example/tasks.md
index edcdbed0..e8920a86 100644
--- a/book/en/src/by-example/tasks.md
+++ b/book/en/src/by-example/tasks.md
@@ -24,7 +24,8 @@ priorities. The three tasks map to 2 interrupts handlers.
``` console
$ cargo run --example task
-{{#include ../../../../ci/expected/task.run}}```
+{{#include ../../../../ci/expected/task.run}}
+```
## Message passing
@@ -40,7 +41,8 @@ The example below showcases three tasks, two of them expect a message.
``` console
$ cargo run --example message
-{{#include ../../../../ci/expected/message.run}}```
+{{#include ../../../../ci/expected/message.run}}
+```
## Capacity
@@ -60,4 +62,5 @@ fail.
``` console
$ cargo run --example capacity
-{{#include ../../../../ci/expected/capacity.run}}```
+{{#include ../../../../ci/expected/capacity.run}}
+```
diff --git a/book/en/src/by-example/tips.md b/book/en/src/by-example/tips.md
index d26b3283..4b1f32bb 100644
--- a/book/en/src/by-example/tips.md
+++ b/book/en/src/by-example/tips.md
@@ -13,7 +13,8 @@ be called from different tasks. Here's one such example:
``` console
$ cargo run --example generics
-{{#include ../../../../ci/expected/generics.run}}```
+{{#include ../../../../ci/expected/generics.run}}
+```
This also lets you change the static priorities of tasks without having to
rewrite code. If you consistently use `lock`s to access the data behind shared
@@ -63,18 +64,21 @@ 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`).
``` console
$ cargo nm --example ramfunc --release | grep ' foo::'
-{{#include ../../../../ci/expected/ramfunc.grep.foo}}```
+{{#include ../../../../ci/expected/ramfunc.grep.foo}}
+```
``` console
$ cargo nm --example ramfunc --release | grep ' bar::'
-{{#include ../../../../ci/expected/ramfunc.grep.bar}}```
+{{#include ../../../../ci/expected/ramfunc.grep.bar}}
+```
## `binds`
@@ -90,7 +94,8 @@ after the function, not the interrupt / exception. Example below:
```
``` console
$ cargo run --example binds
-{{#include ../../../../ci/expected/binds.run}}```
+{{#include ../../../../ci/expected/binds.run}}
+```
## Indirection for faster message passing
@@ -114,4 +119,5 @@ Here's an example where `heapless::Pool` is used to "box" buffers of 128 bytes.
```
``` console
$ cargo run --example binds
-{{#include ../../../../ci/expected/pool.run}}```
+{{#include ../../../../ci/expected/pool.run}}
+```