aboutsummaryrefslogtreecommitdiff
path: root/book/en/src/by-example/hardware_tasks.md
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-03-04 21:10:24 +0000
committerGitHub <noreply@github.com>2023-03-04 21:10:24 +0000
commit7c7d6558f6d9c50fbb4d2487c98c9a5be15f2f7b (patch)
tree80a47f0dc40059014e9448c4c2eb34c54dff45fe /book/en/src/by-example/hardware_tasks.md
parent1c5db277e4161470136dbd2a11e914ff1d383581 (diff)
parent98c5490d94950608d31cd5ad9dd260f2f853735c (diff)
Merge #694
694: RTIC 2 r=AfoHT a=korken89 Co-authored-by: Emil Fresk <emil.fresk@gmail.com> Co-authored-by: Per Lindgren <per.lindgren@ltu.se>
Diffstat (limited to 'book/en/src/by-example/hardware_tasks.md')
-rw-r--r--book/en/src/by-example/hardware_tasks.md31
1 files changed, 12 insertions, 19 deletions
diff --git a/book/en/src/by-example/hardware_tasks.md b/book/en/src/by-example/hardware_tasks.md
index 2d405d3..75dd1a4 100644
--- a/book/en/src/by-example/hardware_tasks.md
+++ b/book/en/src/by-example/hardware_tasks.md
@@ -1,39 +1,32 @@
# Hardware tasks
-At its core RTIC is using a hardware interrupt controller ([ARM NVIC on cortex-m][NVIC])
-to schedule and start execution of tasks. All tasks except `pre-init`, `#[init]` and `#[idle]`
-run as interrupt handlers.
+At its core RTIC is using a hardware interrupt controller ([ARM NVIC on cortex-m][NVIC]) to schedule and start execution of tasks. All tasks except `pre-init`, `#[init]` and `#[idle]` run as interrupt handlers.
Hardware tasks are explicitly bound to interrupt handlers.
-To bind a task to an interrupt, use the `#[task]` attribute argument `binds = InterruptName`.
-This task then becomes the interrupt handler for this hardware interrupt vector.
+To bind a task to an interrupt, use the `#[task]` attribute argument `binds = InterruptName`. This task then becomes the interrupt handler for this hardware interrupt vector.
-All tasks bound to an explicit interrupt are called *hardware tasks* since they
-start execution in reaction to a hardware event.
+All tasks bound to an explicit interrupt are called *hardware tasks* since they start execution in reaction to a hardware event.
-Specifying a non-existing interrupt name will cause a compilation error. The interrupt names
-are commonly defined by [PAC or HAL][pacorhal] crates.
+Specifying a non-existing interrupt name will cause a compilation error. The interrupt names are commonly defined by [PAC or HAL][pacorhal] crates.
-Any available interrupt vector should work. Specific devices may bind
-specific interrupt priorities to specific interrupt vectors outside
-user code control. See for example the
-[nRF “softdevice”](https://github.com/rtic-rs/cortex-m-rtic/issues/434).
+Any available interrupt vector should work. Specific devices may bind specific interrupt priorities to specific interrupt vectors outside user code control. See for example the [nRF “softdevice”](https://github.com/rtic-rs/rtic/issues/434).
-Beware of using interrupt vectors that are used internally by hardware features;
-RTIC is unaware of such hardware specific details.
+Beware of using interrupt vectors that are used internally by hardware features; RTIC is unaware of such hardware specific details.
[pacorhal]: https://docs.rust-embedded.org/book/start/registers.html
[NVIC]: https://developer.arm.com/documentation/100166/0001/Nested-Vectored-Interrupt-Controller/NVIC-functional-description/NVIC-interrupts
-The example below demonstrates the use of the `#[task(binds = InterruptName)]` attribute to declare a
-hardware task bound to an interrupt handler.
+The example below demonstrates the use of the `#[task(binds = InterruptName)]` attribute to declare a hardware task bound to an interrupt handler.
``` rust
-{{#include ../../../../examples/hardware.rs}}
+{{#include ../../../../rtic/examples/hardware.rs}}
```
``` console
$ cargo run --target thumbv7m-none-eabi --example hardware
-{{#include ../../../../ci/expected/hardware.run}}
+```
+
+``` console
+{{#include ../../../../rtic/ci/expected/hardware.run}}
```