diff options
| author | Jorge Aparicio <jorge@japaric.io> | 2019-04-21 20:25:59 +0200 |
|---|---|---|
| committer | Jorge Aparicio <jorge@japaric.io> | 2019-05-01 20:49:25 +0200 |
| commit | 3adc9c31f3fd46af7e3a42a5adba7471452f06e1 (patch) | |
| tree | abd96443848f086082fc3a1dbf794dba9a0ff501 /book/en/src/by-example/resources.md | |
| parent | d538f5b17cf0ad482cd803d7fbaada3349d6485e (diff) | |
update the book
Diffstat (limited to 'book/en/src/by-example/resources.md')
| -rw-r--r-- | book/en/src/by-example/resources.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/book/en/src/by-example/resources.md b/book/en/src/by-example/resources.md index 17f4d13..06f2f06 100644 --- a/book/en/src/by-example/resources.md +++ b/book/en/src/by-example/resources.md @@ -10,7 +10,7 @@ have enough information to optimize the access to the shared data. The `app` attribute has a full view of the application thus it can optimize access to `static` variables. In RTFM we refer to the `static` variables declared inside the `app` pseudo-module as *resources*. To access a resource the -context (`init`, `idle`, `interrupt` or `exception`) must first declare the +context (`init`, `idle`, `interrupt` or `exception`) one must first declare the resource in the `resources` argument of its attribute. In the example below two interrupt handlers access the same resource. No `Mutex` @@ -30,7 +30,7 @@ $ cargo run --example resource The priority of each handler can be declared in the `interrupt` and `exception` attributes. It's not possible to set the priority in any other way because the -runtime takes ownership of the `NVIC` peripheral; it's also not possible to +runtime takes ownership of the `NVIC` peripheral thus it's also not possible to change the priority of a handler / task at runtime. Thanks to this restriction the framework has knowledge about the *static* priorities of all interrupt and exception handlers. @@ -71,10 +71,10 @@ $ cargo run --example lock One more note about priorities: choosing a priority higher than what the device supports (that is `1 << NVIC_PRIO_BITS`) will result in a compile error. Due to -limitations in the language the error is currently far from helpful: it will say -something along the lines of "evaluation of constant value failed" and the span -of the error will *not* point out to the problematic interrupt value -- we are -sorry about this! +limitations in the language the error message is currently far from helpful: it +will say something along the lines of "evaluation of constant value failed" and +the span of the error will *not* point out to the problematic interrupt value -- +we are sorry about this! ## Late resources |
