|
2 | 2 |
|
3 | 3 | The RTIC concept of a software task shares a lot with that of [hardware tasks](./hardware_tasks.md)
|
4 | 4 | with the core difference that a software task is not explicitly bound to a specific
|
5 |
| -interrupt vector, but rather a “dispatcher” interrupt vector running |
6 |
| -at the same priority as the software task. |
| 5 | +interrupt vector, but rather bound to a “dispatcher” interrupt vector running |
| 6 | +at the intended priority of the software task (see below). |
7 | 7 |
|
8 |
| -Thus, software tasks are tasks which are not directly assigned to a specific interrupt vector. |
| 8 | +Thus, software tasks are tasks which are not *directly* bound to an interrupt vector. |
9 | 9 |
|
10 |
| -The `#[task]` attribute used on a function declare it as a software tasks. |
11 |
| -Observe the absence of a `binds = InterruptName` argument to the attribute. |
12 |
| -The static method `task_name::spawn()` spawns (starts) a software task and |
13 |
| -given that there are no higher priority tasks running the task will start executing directly. |
| 10 | +The `#[task]` attributes used on a function determine if it is |
| 11 | +software tasks, specifically the absence of a `binds = InterruptName` |
| 12 | +argument to the attribute definition. |
14 | 13 |
|
15 |
| -All software tasks at the same priority level shares an interrupt handler acting as a dispatcher. |
16 |
| -What differentiates software and hardware tasks are the dispatcher versus bound interrupt vector. |
| 14 | +The static method `task_name::spawn()` spawns (schedules) a software |
| 15 | +task by registering it with a specific dispatcher. If there are no |
| 16 | +higher priority tasks available to the scheduler (which serves a set |
| 17 | +of dispatchers), the task will start executing directly. |
17 | 18 |
|
18 |
| -The interrupt vectors used as dispatchers can not be used by hardware tasks. |
| 19 | +All software tasks at the same priority level share an interrupt handler bound to their dispatcher. |
| 20 | +What differentiates software and hardware tasks is the usage of either a dispatcher or a bound interrupt vector. |
19 | 21 |
|
20 |
| -A list of “free” (not in use by hardware tasks) and usable interrupts allows the framework |
21 |
| -to dispatch software tasks. |
| 22 | +The interrupt vectors used as dispatchers cannot be used by hardware tasks. |
22 | 23 |
|
23 |
| -This list of dispatchers, `dispatchers = [FreeInterrupt1, FreeInterrupt2, ...]` is an |
| 24 | +Availability of a set of “free” (not in use by hardware tasks) and usable interrupt vectors allows the framework |
| 25 | +to dispatch software tasks via dedicated interrupt handlers. |
| 26 | + |
| 27 | +This set of dispatchers, `dispatchers = [FreeInterrupt1, FreeInterrupt2, ...]` is an |
24 | 28 | argument to the `#[app]` attribute.
|
25 | 29 |
|
26 |
| -Each interrupt vector acting as dispatcher gets assigned to one priority level meaning that |
27 |
| -the list of dispatchers need to cover all priority levels used by software tasks. |
| 30 | +Each interrupt vector acting as dispatcher gets assigned to a unique priority level meaning that |
| 31 | +the list of dispatchers needs to cover all priority levels used by software tasks. |
28 | 32 |
|
29 | 33 | Example: The `dispatchers =` argument needs to have at least 3 entries for an application using
|
30 | 34 | three different priorities for software tasks.
|
|
0 commit comments