mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-19 22:35:19 +01:00
More docs updates
This commit is contained in:
parent
f0c3199825
commit
63c6a6afc0
5 changed files with 21 additions and 9 deletions
|
|
@ -1,5 +1,9 @@
|
|||
# Hardware tasks
|
||||
|
||||
In it's core RTIC is based on using the interrupt controller in the hardware to do scheduling and
|
||||
run tasks, as all tasks in the framework are run as interrupt handlers (except `#[init]` and
|
||||
`#[idle]`). This also means that you can directly bind tasks to interrupt handlers.
|
||||
|
||||
To declare interrupt handlers the `#[task]` attribute takes a `binds = InterruptName` argument whose
|
||||
value is the name of the interrupt to which the handler will be bound to; the
|
||||
function used with this attribute becomes the interrupt handler. Within the
|
||||
|
|
@ -10,8 +14,7 @@ Providing an interrupt name that does not exist will cause a compile error to he
|
|||
errors.
|
||||
|
||||
The example below demonstrates the use of the `#[task]` attribute to declare an
|
||||
interrupt handler. Like in the case of `#[init]` and `#[idle]` local `static
|
||||
mut` variables are safe to use within a hardware task.
|
||||
interrupt handler.
|
||||
|
||||
``` rust
|
||||
{{#include ../../../../examples/hardware.rs}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue