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/internals/access.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/internals/access.md')
| -rw-r--r-- | book/en/src/internals/access.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/book/en/src/internals/access.md b/book/en/src/internals/access.md index 6433707..3894470 100644 --- a/book/en/src/internals/access.md +++ b/book/en/src/internals/access.md @@ -15,7 +15,7 @@ To achieve the fine-grained access control where tasks can only access the static variables (resources) that they have specified in their RTIC attribute the RTIC framework performs a source code level transformation. This transformation consists of placing the resources (static variables) specified by -the user *inside* a `const` item and the user code *outside* the `const` item. +the user *inside* a module and the user code *outside* the module. This makes it impossible for the user code to refer to these static variables. Access to the resources is then given to each task using a `Resources` struct @@ -29,7 +29,7 @@ happens behind the scenes: ``` rust #[rtic::app(device = ..)] -const APP: () = { +mod app { static mut X: u64: 0; static mut Y: bool: 0; @@ -49,7 +49,7 @@ const APP: () = { } // .. -}; +} ``` The framework produces codes like this: @@ -103,8 +103,8 @@ pub mod bar { } /// Implementation details -const APP: () = { - // everything inside this `const` item is hidden from user code +mod app { + // everything inside this module is hidden from user code static mut X: u64 = 0; static mut Y: bool = 0; @@ -154,5 +154,5 @@ const APP: () = { // .. }); } -}; +} ``` |
