diff options
| author | Daniel Carosone <Daniel.Carosone@gmail.com> | 2020-10-07 09:22:38 +1100 |
|---|---|---|
| committer | Daniel Carosone <Daniel.Carosone@gmail.com> | 2020-10-07 09:22:38 +1100 |
| commit | f386cb63cb6d3cd6642debfb4dc1bde97b325550 (patch) | |
| tree | 30b21968997f809dbbba59117db93254607fa22d /book/en/src/by-example/resources.md | |
| parent | 3d6a0ea64fb2661ee1150a84425f50c18c2de9ad (diff) | |
| parent | b1e1abae29591e50ebf345a2bd249a73e564cea9 (diff) | |
Merge branch 'master'
of https://github.com/rtic-rs/cortex-m-rtic
Diffstat (limited to 'book/en/src/by-example/resources.md')
| -rw-r--r-- | book/en/src/by-example/resources.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/book/en/src/by-example/resources.md b/book/en/src/by-example/resources.md index 9b6e5a8..9d90fbe 100644 --- a/book/en/src/by-example/resources.md +++ b/book/en/src/by-example/resources.md @@ -4,11 +4,13 @@ The framework provides an abstraction to share data between any of the contexts we saw in the previous section (task handlers, `init` and `idle`): resources. Resources are data visible only to functions declared within the `#[app]` -pseudo-module. The framework gives the user complete control over which context +module. The framework gives the user complete control over which context can access which resource. All resources are declared as a single `struct` within the `#[app]` -pseudo-module. Each field in the structure corresponds to a different resource. +module. Each field in the structure corresponds to a different resource. +The `struct` must be annotated with the following attribute: `#[resources]`. + Resources can optionally be given an initial value using the `#[init]` attribute. Resources that are not given an initial value are referred to as *late* resources and are covered in more detail in a follow-up section in this |
