rtic/book/en/src/by-example/software_tasks.md

17 lines
615 B
Markdown
Raw Normal View History

2021-09-22 13:22:45 +02:00
# Software tasks & spawn
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.
This is exemplified in the following:
``` rust
{{#include ../../../../examples/spawn.rs}}
```
``` console
$ cargo run --target thumbv7m-none-eabi --example spawn
{{#include ../../../../ci/expected/spawn.run}}
```