aboutsummaryrefslogtreecommitdiff
path: root/book/en/src/by-example/software_tasks.md
diff options
context:
space:
mode:
authorHenrik Tjäder <henrik@grepit.se>2022-02-05 13:38:01 +0100
committerHenrik Tjäder <henrik@grepit.se>2022-02-05 13:38:01 +0100
commita39d306649ebd7c6e99f5914bd5d6988a1705d4b (patch)
tree8a6d5a3b538dffc53ed8b10d8337d7b7808da01d /book/en/src/by-example/software_tasks.md
parent9f8248a0c93c841704900454010ab9c82639d2d9 (diff)
Docs: SW and HW tasks
Diffstat (limited to 'book/en/src/by-example/software_tasks.md')
-rw-r--r--book/en/src/by-example/software_tasks.md22
1 files changed, 14 insertions, 8 deletions
diff --git a/book/en/src/by-example/software_tasks.md b/book/en/src/by-example/software_tasks.md
index f244ca6..ea40697 100644
--- a/book/en/src/by-example/software_tasks.md
+++ b/book/en/src/by-example/software_tasks.md
@@ -1,19 +1,25 @@
# Software tasks & spawn
-Software tasks are tasks which are not directly assigned to a specific interrupt vector.
+The RTIC concept of a software task shares a lot with that of [hardware tasks][hardware_tasks.md]
+with the core difference that a software task is not explicitly bound to a specific
+interrupt vector, but rather a “dispatcher” interrupt vector running
+at the same priority as the software task.
-They run as interrupt handlers where all software tasks at the
-same priority level shares a "free" interrupt handler acting as a dispatcher.
-Thus, what differentiates software and hardware tasks are the dispatcher versus
-bound interrupt vector.
-
-These free interrupts used as dispatchers are interrupt vectors not used by hardware tasks.
+Thus, software tasks are tasks which are not directly assigned to a specific interrupt vector.
The `#[task]` attribute used on a function declare it as a software tasks.
+Observe the absence of a `binds = InterruptName` argument to the attribute.
The static method `task_name::spawn()` spawns (starts) a software task and
given that there are no higher priority tasks running the task will start executing directly.
-A list of “free” and usable interrupts allows the framework to dispatch software tasks.
+All software tasks at the same priority level shares an interrupt handler acting as a dispatcher.
+What differentiates software and hardware tasks are the dispatcher versus bound interrupt vector.
+
+The interrupt vectors used as dispatchers can not be used by hardware tasks.
+
+A list of “free” (not in use by hardware tasks) and usable interrupts allows the framework
+to dispatch software tasks.
+
This list of dispatchers, `dispatchers = [FreeInterrupt1, FreeInterrupt2, ...]` is an
argument to the `#[app]` attribute.