8000 Docs 2 by datdenkikniet · Pull Request #741 · rtic-rs/rtic · GitHub
[go: up one dir, main page]

Skip to content

Docs 2 #741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
16f8ea9
Fix this link
datdenkikniet Apr 22, 2023
1dc2f80
Begin migration guide
datdenkikniet Apr 22, 2023
d90fa95
Add some more
datdenkikniet Apr 22, 2023
6c91ff2
Include the examples
datdenkikniet Apr 22, 2023
825b2c2
Update tips on Monotonic implemenations
datdenkikniet Apr 22, 2023
4437f12
Remove link to inactive `embedded_time`
datdenkikniet Apr 22, 2023
9ddae20
Fix links & info
datdenkikniet Apr 22, 2023
d22faec
Fix run-on sentence
datdenkikniet Apr 22, 2023
ed465b0
Fix #699
datdenkikniet Apr 22, 2023
3d97c9e
Move deprecated migration guides to deprecated folder
datdenkikniet Apr 22, 2023
3d98102
Refer to rtic-rs/rtic/examples instead
datdenkikniet Apr 22, 2023
a14d240
Update delay.md file to be a bit easier to read, and add spoiler tags…
datdenkikniet Apr 22, 2023
552ecd4
Promote starting a new project to it's own chapter
datdenkikniet Apr 22, 2023
a76f4cd
monotonic.md is now deprecated
datdenkikniet Apr 22, 2023
6c2c1ab
Clarify delay and timeout uses monotonics
datdenkikniet Apr 22, 2023
cb0ceea
Remove v1 reference here
datdenkikniet Apr 23, 2023
e51146a
Move tips into their own subdir
datdenkikniet Apr 23, 2023
0807aa5
Include this code as blocks instead
datdenkikniet Apr 23, 2023
a66540e
Disable the playground on all of these
datdenkikniet Apr 23, 2023
d41d28b
Add check-book.sh script
datdenkikniet May 5, 2023
0b8ea07
Fix links
datdenkikniet May 5, 2023
e3603d1
Rename deprecated to archive
datdenkikniet May 5, 2023
f2a57de
taste the rainbow!
datdenkikniet May 5, 2023
5b705dd
Don't build core and alloc & update Cargo.lock
datdenkikniet May 5, 2023
03b16a3
Archive app_task.md
datdenkikniet May 5, 2023
5c6483f
Update these
datdenkikniet May 5, 2023
ab17bbf
Demarcate a bit more
datdenkikniet May 5, 2023
4b3bf59
Move some more stuff to the archive, update this link
datdenkikniet May 20, 2023
039c2b8
Add some docs on RTIC AND embassy
datdenkikniet May 20, 2023
311291b
Make Monotonic implementation more obvious
datdenkikniet May 20, 2023
9fa073f
Fix link
datdenkikniet May 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Demarcate a bit more
  • Loading branch information
datdenkikniet committed May 11, 2023
commit ab17bbf9f37e81b9aab88694e73d23f54664fa01
6 changes: 6 additions & 0 deletions book/en/src/by-example/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ At compile time the task/resource model is analyzed under the Stack Resource Pol

Overall, the generated code infers no additional overhead in comparison to a hand-written implementation, thus in Rust terms RTIC offers a zero-cost abstraction to concurrency.

## Priority

Priorities in RTIC are specified using the `priority = N` (where N is a positive number) argument passed to the `#[task]` attribute. All `#[task]`s can have a priority. If the priority of a task is not specified, it is set to the default value of 1.

Priorities in RTIC follow a higher value = more important scheme. For examples, a task with priority 2 will preempt a task with priority 1.

## An RTIC application example

To give a taste of RTIC, the following example contains commonly used features.
Expand Down
9 changes: 4 additions & 5 deletions book/en/src/by-example/software_tasks.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# Software tasks & spawn

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 bound to a “dispatcher” interrupt vector running at the intended priority of the software task (see below).
The RTIC concept of a software task shares a lot with that of [hardware tasks](./hardware_tasks.md). The core difference is that a software task is not explicitly bound to a specific interrupt vector, but rather bound to a “dispatcher” interrupt vector running at the intended priority of the software task (see below).

Similarly to *hardware* tasks, the `#[task]` attribute used on a function declare it as a task. The absence of a `binds = InterruptName` argument to the attribute declares the function as a *software task*.

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.

The *software* task itself is given as an `async` Rust function, which allows the user to optionally `await` future events. This allows to blend reactive programming (by means of *hardware* tasks) with sequential programming (by means of *software* tasks).

Whereas, *hardware* tasks are assumed to run-to-completion (and return), *software* tasks may be started (`spawned`) once and run forever, with the side condition that any loop (execution path) is broken by at least one `await` (yielding operation).
While *hardware* tasks are assumed to run-to-completion (and return), *software* tasks may be started (`spawned`) once and run forever, on the condition that any loop (execution path) is broken by at least one `await` (yielding operation).

All *software* tasks at the same priority level shares an interrupt handler acting as an async executor dispatching the software tasks.
## Dispatchers

This list of dispatchers, `dispatchers = [FreeInterrupt1, FreeInterrupt2, ...]` is an argument to the `#[app]` attribute, where you define the set of free and usable interrupts.
All *software* tasks at the same priority level share an interrupt handler acting as an async executor dispatching the software tasks. This list of dispatchers, `dispatchers = [FreeInterrupt1, FreeInterrupt2, ...]` is an argument to the `#[app]` attribute, where you define the set of free and usable interrupts.

Each interrupt vector acting as dispatcher gets assigned to one priority level meaning that the list of dispatchers need to cover all priority levels used by software tasks.

Expand Down
0