From 458db0b73742da0250d119a37341e7d321cbb8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Mon, 12 Oct 2020 08:06:37 +0000 Subject: [PATCH] Markdown end of fenced code should be on a separate line 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 --- book/en/src/by-example/app.md | 9 ++++++--- book/en/src/by-example/new.md | 3 ++- book/en/src/by-example/resources.md | 12 ++++++++---- book/en/src/by-example/singletons.md | 3 ++- book/en/src/by-example/tasks.md | 9 ++++++--- book/en/src/by-example/tips.md | 18 ++++++++++++------ 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 996b8c1672..ff313510f8 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 ae49ef21af..855771fb99 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 17f4d139f3..5c1ddf0e18 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 0823f057f5..a29ce990ee 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 edcdbed0c5..e8920a8653 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 d26b328387..4b1f32bb45 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}} +```