aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2020-10-02 11:17:56 +0000
committerGravatar GitHub <noreply@github.com> 2020-10-02 11:17:56 +0000
commit97eae45fa571ba1c470e9ab649ba7570beb963b0 (patch)
tree10730f3d24e43fa70294d15ba1382003e6fd7898
parent4981af8a4bfe5ee5442521794d851b0dc0313488 (diff)
parentbaa2edfe72ec2e33a84dfebc6c4baf2c2b8d55c2 (diff)
downloadrtic-97eae45fa571ba1c470e9ab649ba7570beb963b0.tar.gz
rtic-97eae45fa571ba1c470e9ab649ba7570beb963b0.tar.zst
rtic-97eae45fa571ba1c470e9ab649ba7570beb963b0.zip
Merge #375
375: close console text blocks on a new line r=AfoHT a=dcarosone fixes #369 Co-authored-by: Daniel Carosone <Daniel.Carosone@gmail.com>
-rw-r--r--book/en/src/by-example/app.md12
-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/tasks.md9
-rw-r--r--book/en/src/by-example/tips.md12
5 files changed, 32 insertions, 16 deletions
diff --git a/book/en/src/by-example/app.md b/book/en/src/by-example/app.md
index 9a073ac4..344cefc7 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`
@@ -86,7 +87,8 @@ in LLVM which miss-optimizes empty loops to a `UDF` instruction in release mode.
``` console
$ cargo run --example idle
-{{#include ../../../../ci/expected/idle.run}}```
+{{#include ../../../../ci/expected/idle.run}}
+```
## Hardware tasks
@@ -107,7 +109,8 @@ mut` variables are safe to use within a hardware task.
``` console
$ cargo run --example hardware
-{{#include ../../../../ci/expected/hardware.run}}```
+{{#include ../../../../ci/expected/hardware.run}}
+```
So far all the RTIC applications we have seen look no different than the
applications one can write using only the `cortex-m-rt` crate. From this point
@@ -139,7 +142,8 @@ The following example showcases the priority based scheduling of tasks.
``` console
$ cargo run --example preempt
-{{#include ../../../../ci/expected/preempt.run}}```
+{{#include ../../../../ci/expected/preempt.run}}
+```
Note that the task `gpiob` does *not* preempt task `gpioc` because its priority
is the *same* as `gpioc`'s. However, once `gpioc` terminates the execution of
diff --git a/book/en/src/by-example/new.md b/book/en/src/by-example/new.md
index abcc36de..866a9fa5 100644
--- a/book/en/src/by-example/new.md
+++ b/book/en/src/by-example/new.md
@@ -63,4 +63,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 b9e92d1e..d67a72ff 100644
--- a/book/en/src/by-example/resources.md
+++ b/book/en/src/by-example/resources.md
@@ -29,7 +29,8 @@ access to a resource named `shared`.
``` console
$ cargo run --example resource
-{{#include ../../../../ci/expected/resource.run}}```
+{{#include ../../../../ci/expected/resource.run}}
+```
Note that the `shared` resource cannot be accessed from `idle`. Attempting to do
so results in a compile error.
@@ -71,7 +72,8 @@ lowest priority handler.
``` console
$ cargo run --example lock
-{{#include ../../../../ci/expected/lock.run}}```
+{{#include ../../../../ci/expected/lock.run}}
+```
## Late resources
@@ -97,7 +99,8 @@ the consumer resource.
``` console
$ cargo run --example late
-{{#include ../../../../ci/expected/late.run}}```
+{{#include ../../../../ci/expected/late.run}}
+```
## Only shared access
@@ -127,4 +130,5 @@ any kind of lock.
``` console
$ cargo run --example only-shared-access
-{{#include ../../../../ci/expected/only-shared-access.run}}```
+{{#include ../../../../ci/expected/only-shared-access.run}}
+```
diff --git a/book/en/src/by-example/tasks.md b/book/en/src/by-example/tasks.md
index d0b5acb9..345e224e 100644
--- a/book/en/src/by-example/tasks.md
+++ b/book/en/src/by-example/tasks.md
@@ -25,7 +25,8 @@ priorities. The three software tasks are mapped to 2 interrupts handlers.
``` console
$ cargo run --example task
-{{#include ../../../../ci/expected/task.run}}```
+{{#include ../../../../ci/expected/task.run}}
+```
## Message passing
@@ -41,7 +42,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
@@ -63,7 +65,8 @@ fail (panic).
``` console
$ cargo run --example capacity
-{{#include ../../../../ci/expected/capacity.run}}```
+{{#include ../../../../ci/expected/capacity.run}}
+```
## Error handling
diff --git a/book/en/src/by-example/tips.md b/book/en/src/by-example/tips.md
index b191b9da..5a447088 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