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>2021-12-21 19:02:49 +0000
committerGitHub <noreply@github.com>2021-12-21 19:02:49 +0000
commitc78177c37e3192c7a41a3ea8e7c139751c1a8989 (patch)
treed5092fa9f154994c27f710f3ec4cacdb651fd96d /book/en/src/by-example/hardware_tasks.md
parent37facfb5bf9aca11c43868cb8880b12b9f6b336a (diff)
parente249813ad7a5670dd9a1a70d46b72aa02ce4dce0 (diff)
Merge #563
563: Docs touchup r=korken89 a=AfoHT Unleashed some language linters on the book Co-authored-by: Henrik Tjäder <henrik@grepit.se> Co-authored-by: perlindgren <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.md25
1 files changed, 14 insertions, 11 deletions
diff --git a/book/en/src/by-example/hardware_tasks.md b/book/en/src/by-example/hardware_tasks.md
index d596876..30b88d0 100644
--- a/book/en/src/by-example/hardware_tasks.md
+++ b/book/en/src/by-example/hardware_tasks.md
@@ -1,17 +1,21 @@
# Hardware tasks
-At its core RTIC is based on using the interrupt controller in the hardware to do scheduling and
-run tasks, as all tasks in the framework are run as interrupt handlers (except `#[init]` and
-`#[idle]`). This also means that you can directly bind tasks to interrupt handlers.
+At its core RTIC is using the hardware interrupt controller ([ARM NVIC on cortex-m][NVIC])
+to perform scheduling and executing tasks, and all tasks except `#[init]` and `#[idle]`
+run as interrupt handlers.
+This also means that you can manually bind tasks to interrupt handlers.
-To declare interrupt handlers the `#[task]` attribute takes a `binds = InterruptName` argument whose
-value is the name of the interrupt to which the handler will be bound to; the
-function used with this attribute becomes the interrupt handler. Within the
-framework these type of tasks are referred to as *hardware* tasks, because they
-start executing in reaction to a hardware event.
+To bind an interrupt use the `#[task]` attribute argument `binds = InterruptName`.
+This task becomes the interrupt handler for this hardware interrupt vector.
-Providing an interrupt name that does not exist will cause a compile error to help with accidental
-errors.
+All tasks bound to an explicit interrupt are *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.
+
+[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]` attribute to declare an
interrupt handler.
@@ -24,4 +28,3 @@ interrupt handler.
$ cargo run --target thumbv7m-none-eabi --example hardware
{{#include ../../../../ci/expected/hardware.run}}
```
-