aboutsummaryrefslogtreecommitdiff
path: root/book/en/src/by-example/hardware_tasks.md
diff options
context:
space:
mode:
authorHenrik Tjäder <henrik@tjaders.com>2023-02-01 01:15:56 +0100
committerHenrik Tjäder <henrik@tjaders.com>2023-03-01 00:33:40 +0100
commit63f3d784fe519d248c89b64006dbc13d83e07360 (patch)
tree8be6e44f20126fac674bf213eba29f81d56285bd /book/en/src/by-example/hardware_tasks.md
parent8d46fb9cf9f2b9cdd14844672ad840d777739cb2 (diff)
Revert accidental removal of editorial changes
Diffstat (limited to 'book/en/src/by-example/hardware_tasks.md')
-rw-r--r--book/en/src/by-example/hardware_tasks.md14
1 files changed, 8 insertions, 6 deletions
diff --git a/book/en/src/by-example/hardware_tasks.md b/book/en/src/by-example/hardware_tasks.md
index e3e51ac..cb20a7c 100644
--- a/book/en/src/by-example/hardware_tasks.md
+++ b/book/en/src/by-example/hardware_tasks.md
@@ -1,21 +1,23 @@
# Hardware tasks
-At its core RTIC is using the hardware interrupt controller ([ARM NVIC on cortex-m][NVIC]) to perform scheduling and executing tasks, and all (*hardware*) tasks except `#[init]` and `#[idle]` run as interrupt handlers. This also means that you can manually bind tasks to 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.
-To bind an interrupt use the `#[task]` attribute argument `binds = InterruptName`. This task becomes the interrupt handler for this hardware interrupt vector.
+Hardware tasks are explicitly bound to interrupt handlers.
-All tasks bound to an explicit interrupt are *hardware tasks* since they start execution in reaction to a hardware event (interrupt).
+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.
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, but different hardware might have added special properties to select interrupt priority levels, such as 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/cortex-m-rtic/issues/434).
-Beware of re-purposing interrupt vectors 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. In the example the interrupt triggering task execution is manually pended (`rtic::pend(Interrupt::UART0)`). However, in the typical case, interrupts are pended by the hardware peripheral. RTIC does not interfere with mechanisms for clearing peripheral interrupts, so any hardware specific implementation is completely up to the implementer.
+The example below demonstrates the use of the `#[task(binds = InterruptName)]` attribute to declare a hardware task bound to an interrupt handler.
``` rust
{{#include ../../../../rtic/examples/hardware.rs}}