aboutsummaryrefslogtreecommitdiff
path: root/book/en/src/by-example/software_tasks.md
diff options
context:
space:
mode:
authorEmil Fresk <emil.fresk@gmail.com>2021-09-27 10:12:32 +0200
committerEmil Fresk <emil.fresk@gmail.com>2021-09-27 10:20:19 +0200
commit63c6a6afc033432f58d1ec3de39640c584553153 (patch)
tree0797d6cd62d99d8f1d9192f254478e935214d669 /book/en/src/by-example/software_tasks.md
parentf0c319982524988fa67cac3c59a4a4a863c409c9 (diff)
More docs updates
Diffstat (limited to 'book/en/src/by-example/software_tasks.md')
-rw-r--r--book/en/src/by-example/software_tasks.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/book/en/src/by-example/software_tasks.md b/book/en/src/by-example/software_tasks.md
index 0c9b62e..f78efea 100644
--- a/book/en/src/by-example/software_tasks.md
+++ b/book/en/src/by-example/software_tasks.md
@@ -1,9 +1,20 @@
# Software tasks & spawn
+Software tasks, as hardware tasks, are run as interrupt handlers where all software tasks at the
+same priority shares a "free" interrupt handler to run from, called a dispatcher. These free
+interrupts are interrupt vectors not used by hardware tasks.
+
To declare tasks in the framework the `#[task]` attribute is used on a function.
By default these tasks are referred to as software tasks as they do not have a direct coupling to
an interrupt handler. Software tasks can be spawned (started) using the `task_name::spawn()` static
method which will directly run the task given that there are no higher priority tasks running.
+
+To indicate to the framework which interrupts are free for use to dispatch software tasks with the
+`#[app]` attribute has a `dispatchers = [FreeInterrupt1, FreeInterrupt2, ...]` argument. You need
+to provide as many dispatchers as there are priority levels used by software tasks, as an
+dispatcher is assigned per interrupt level. The framework will also give a compile error if there
+are not enough dispatchers provided.
+
This is exemplified in the following:
``` rust