mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-25 21:19:35 +01:00
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
This commit is contained in:
parent
32c5a8f213
commit
458db0b737
6 changed files with 36 additions and 18 deletions
|
@ -55,7 +55,8 @@ process.
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo run --example init
|
$ cargo run --example init
|
||||||
{{#include ../../../../ci/expected/init.run}}```
|
{{#include ../../../../ci/expected/init.run}}
|
||||||
|
```
|
||||||
|
|
||||||
## `idle`
|
## `idle`
|
||||||
|
|
||||||
|
@ -83,7 +84,8 @@ The example below shows that `idle` runs after `init`.
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo run --example idle
|
$ cargo run --example idle
|
||||||
{{#include ../../../../ci/expected/idle.run}}```
|
{{#include ../../../../ci/expected/idle.run}}
|
||||||
|
```
|
||||||
|
|
||||||
## `interrupt` / `exception`
|
## `interrupt` / `exception`
|
||||||
|
|
||||||
|
@ -98,7 +100,8 @@ and exception handlers. In RTFM, we refer to interrupt and exception handlers as
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo run --example interrupt
|
$ 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
|
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
|
applications one can write using only the `cortex-m-rt` crate. In the next
|
||||||
|
|
|
@ -64,4 +64,5 @@ $ cargo add panic-semihosting
|
||||||
``` console
|
``` console
|
||||||
$ # NOTE: I have uncommented the `runner` option in `.cargo/config`
|
$ # NOTE: I have uncommented the `runner` option in `.cargo/config`
|
||||||
$ cargo run
|
$ cargo run
|
||||||
{{#include ../../../../ci/expected/init.run}}```
|
{{#include ../../../../ci/expected/init.run}}
|
||||||
|
```
|
||||||
|
|
|
@ -24,7 +24,8 @@ two handlers.
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo run --example resource
|
$ cargo run --example resource
|
||||||
{{#include ../../../../ci/expected/resource.run}}```
|
{{#include ../../../../ci/expected/resource.run}}
|
||||||
|
```
|
||||||
|
|
||||||
## Priorities
|
## Priorities
|
||||||
|
|
||||||
|
@ -67,7 +68,8 @@ the critical section created by the lowest priority handler.
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo run --example lock
|
$ 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
|
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
|
supports (that is `1 << NVIC_PRIO_BITS`) will result in a compile error. Due to
|
||||||
|
@ -103,7 +105,8 @@ the consumer resource.
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo run --example late
|
$ cargo run --example late
|
||||||
{{#include ../../../../ci/expected/late.run}}```
|
{{#include ../../../../ci/expected/late.run}}
|
||||||
|
```
|
||||||
|
|
||||||
## `static` resources
|
## `static` resources
|
||||||
|
|
||||||
|
@ -123,4 +126,5 @@ two tasks that run at different priorities.
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo run --example static
|
$ cargo run --example static
|
||||||
{{#include ../../../../ci/expected/static.run}}```
|
{{#include ../../../../ci/expected/static.run}}
|
||||||
|
```
|
||||||
|
|
|
@ -23,4 +23,5 @@ the [`alloc-singleton`] abstractions.
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo run --example singleton
|
$ cargo run --example singleton
|
||||||
{{#include ../../../../ci/expected/singleton.run}}```
|
{{#include ../../../../ci/expected/singleton.run}}
|
||||||
|
```
|
||||||
|
|
|
@ -24,7 +24,8 @@ priorities. The three tasks map to 2 interrupts handlers.
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo run --example task
|
$ cargo run --example task
|
||||||
{{#include ../../../../ci/expected/task.run}}```
|
{{#include ../../../../ci/expected/task.run}}
|
||||||
|
```
|
||||||
|
|
||||||
## Message passing
|
## Message passing
|
||||||
|
|
||||||
|
@ -40,7 +41,8 @@ The example below showcases three tasks, two of them expect a message.
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo run --example message
|
$ cargo run --example message
|
||||||
{{#include ../../../../ci/expected/message.run}}```
|
{{#include ../../../../ci/expected/message.run}}
|
||||||
|
```
|
||||||
|
|
||||||
## Capacity
|
## Capacity
|
||||||
|
|
||||||
|
@ -60,4 +62,5 @@ fail.
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo run --example capacity
|
$ cargo run --example capacity
|
||||||
{{#include ../../../../ci/expected/capacity.run}}```
|
{{#include ../../../../ci/expected/capacity.run}}
|
||||||
|
```
|
||||||
|
|
|
@ -13,7 +13,8 @@ be called from different tasks. Here's one such example:
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo run --example generics
|
$ 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
|
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
|
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
|
``` console
|
||||||
$ cargo run --example ramfunc
|
$ 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
|
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`).
|
(`0x2000_0000`), whereas `foo` ended in Flash (`0x0000_0000`).
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo nm --example ramfunc --release | grep ' foo::'
|
$ cargo nm --example ramfunc --release | grep ' foo::'
|
||||||
{{#include ../../../../ci/expected/ramfunc.grep.foo}}```
|
{{#include ../../../../ci/expected/ramfunc.grep.foo}}
|
||||||
|
```
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo nm --example ramfunc --release | grep ' bar::'
|
$ cargo nm --example ramfunc --release | grep ' bar::'
|
||||||
{{#include ../../../../ci/expected/ramfunc.grep.bar}}```
|
{{#include ../../../../ci/expected/ramfunc.grep.bar}}
|
||||||
|
```
|
||||||
|
|
||||||
## `binds`
|
## `binds`
|
||||||
|
|
||||||
|
@ -90,7 +94,8 @@ after the function, not the interrupt / exception. Example below:
|
||||||
```
|
```
|
||||||
``` console
|
``` console
|
||||||
$ cargo run --example binds
|
$ cargo run --example binds
|
||||||
{{#include ../../../../ci/expected/binds.run}}```
|
{{#include ../../../../ci/expected/binds.run}}
|
||||||
|
```
|
||||||
|
|
||||||
## Indirection for faster message passing
|
## 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
|
``` console
|
||||||
$ cargo run --example binds
|
$ cargo run --example binds
|
||||||
{{#include ../../../../ci/expected/pool.run}}```
|
{{#include ../../../../ci/expected/pool.run}}
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue