diff options
Diffstat (limited to 'book')
| -rw-r--r-- | book/en/src/by-example/app.md | 14 | ||||
| -rw-r--r-- | book/en/src/by-example/resources.md | 10 | ||||
| -rw-r--r-- | book/ru/src/by-example/app.md | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/book/en/src/by-example/app.md b/book/en/src/by-example/app.md index f687194..2450c59 100644 --- a/book/en/src/by-example/app.md +++ b/book/en/src/by-example/app.md @@ -70,7 +70,7 @@ so it must run forever. When no `idle` function is declared, the runtime sets the [SLEEPONEXIT] bit and then sends the microcontroller to sleep after running `init`. -[SLEEPONEXIT]: https://developer.arm.com/products/architecture/cpu-architecture/m-profile/docs/100737/0100/power-management/sleep-mode/sleep-on-exit-bit +[SLEEPONEXIT]: https://developer.arm.com/docs/100737/0100/power-management/sleep-mode/sleep-on-exit-bit Like in `init`, `static mut` variables will be transformed into `&'static mut` references that are safe to access. @@ -103,10 +103,10 @@ mut` variables are safe to use within a hardware task. ``` ``` console -$ cargo run --example interrupt +$ cargo run --example hardware {{#include ../../../../ci/expected/hardware.run}}``` -So far all the RTFM applications we have seen look no different that the +So far all the RTFM applications we have seen look no different than the applications one can write using only the `cortex-m-rt` crate. From this point we start introducing features unique to RTFM. @@ -115,7 +115,7 @@ we start introducing features unique to RTFM. The static priority of each handler can be declared in the `task` attribute using the `priority` argument. Tasks can have priorities in the range `1..=(1 << NVIC_PRIO_BITS)` where `NVIC_PRIO_BITS` is a constant defined in the `device` -crate. When the `priority` argument is omitted the priority is assumed to be +crate. When the `priority` argument is omitted, the priority is assumed to be `1`. The `idle` task has a non-configurable static priority of `0`, the lowest priority. @@ -135,17 +135,17 @@ The following example showcases the priority based scheduling of tasks. ``` ``` console -$ cargo run --example interrupt +$ cargo run --example preempt {{#include ../../../../ci/expected/preempt.run}}``` Note that the task `gpiob` does *not* preempt task `gpioc` because its priority is the *same* as `gpioc`'s. However, once `gpioc` terminates the execution of -task `gpiob` is prioritized over `gpioa`'s due to its higher priority. `gpioa` +task, `gpiob` is prioritized over `gpioa` due to its higher priority. `gpioa` is resumed only after `gpiob` terminates. 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 message is currently far from helpful: it +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! diff --git a/book/en/src/by-example/resources.md b/book/en/src/by-example/resources.md index b33ca9b..db7630e 100644 --- a/book/en/src/by-example/resources.md +++ b/book/en/src/by-example/resources.md @@ -11,7 +11,7 @@ All resources are declared as a single `struct` within the `#[app]` pseudo-module. Each field in the structure corresponds to a different resource. 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 +*late* resources and are covered in more detail in a follow-up section in this page. Each context (task handler, `init` or `idle`) must declare the resources it @@ -31,7 +31,7 @@ access to a resource named `shared`. $ cargo run --example resource {{#include ../../../../ci/expected/resource.run}}``` -Note that the `shared` resource cannot accessed from `idle`. Attempting to do +Note that the `shared` resource cannot be accessed from `idle`. Attempting to do so results in a compile error. ## `lock` @@ -75,14 +75,14 @@ $ cargo run --example lock ## Late resources -Late resources are resources that are not given an initial value at compile -using the `#[init]` attribute but instead are initialized are runtime using the +Late resources are resources that are not given an initial value at compile time +using the `#[init]` attribute but instead are initialized at runtime using the `init::LateResources` values returned by the `init` function. Late resources are useful for *moving* (as in transferring the ownership of) peripherals initialized in `init` into interrupt handlers. -The example below uses late resources to stablish a lockless, one-way channel +The example below uses late resources to establish a lockless, one-way channel between the `UART0` interrupt handler and the `idle` task. A single producer single consumer [`Queue`] is used as the channel. The queue is split into consumer and producer end points in `init` and then each end point is stored diff --git a/book/ru/src/by-example/app.md b/book/ru/src/by-example/app.md index 7dc0812..884257d 100644 --- a/book/ru/src/by-example/app.md +++ b/book/ru/src/by-example/app.md @@ -66,7 +66,7 @@ $ cargo run --example init Когда функция `idle` не определена, рантайм устанавливает бит [SLEEPONEXIT], после чего отправляет микроконтроллер в состояние сна после выполнения `init`. -[SLEEPONEXIT]: https://developer.arm.com/products/architecture/cpu-architecture/m-profile/docs/100737/0100/power-management/sleep-mode/sleep-on-exit-bit +[SLEEPONEXIT]: https://developer.arm.com/docs/100737/0100/power-management/sleep-mode/sleep-on-exit-bit Как и в `init`, переменные `static mut`будут преобразованы в ссылки `&'static mut` с безопасным доступом. |
