aboutsummaryrefslogtreecommitdiff
path: root/book/en/src/internals/critical-sections.md
diff options
context:
space:
mode:
authorHenrik Tjäder <henrik@tjaders.com>2020-06-11 17:18:29 +0000
committerHenrik Tjäder <henrik@tjaders.com>2020-06-11 17:18:29 +0000
commit602a5b4374961dbcf7f3290053ab9b01f0622c67 (patch)
treed3e64006a7b310d34d82df7aa2a4467c03595e55 /book/en/src/internals/critical-sections.md
parent4a0393f756cc3ccd480f839eb6b6a9349326fe8e (diff)
Rename RTFM to RTIC
Diffstat (limited to 'book/en/src/internals/critical-sections.md')
-rw-r--r--book/en/src/internals/critical-sections.md28
1 files changed, 14 insertions, 14 deletions
diff --git a/book/en/src/internals/critical-sections.md b/book/en/src/internals/critical-sections.md
index 94aee2c..f95a5a7 100644
--- a/book/en/src/internals/critical-sections.md
+++ b/book/en/src/internals/critical-sections.md
@@ -2,7 +2,7 @@
When a resource (static variable) is shared between two, or more, tasks that run
at different priorities some form of mutual exclusion is required to mutate the
-memory in a data race free manner. In RTFM we use priority-based critical
+memory in a data race free manner. In RTIC we use priority-based critical
sections to guarantee mutual exclusion (see the [Immediate Ceiling Priority
Protocol][icpp]).
@@ -31,7 +31,7 @@ task we give it a *resource proxy*, whereas we give a unique reference
The example below shows the different types handed out to each task:
``` rust
-#[rtfm::app(device = ..)]
+#[rtic::app(device = ..)]
const APP: () = {
struct Resources {
#[init(0)]
@@ -102,7 +102,7 @@ pub mod bar {
const APP: () = {
static mut x: u64 = 0;
- impl rtfm::Mutex for resources::x {
+ impl rtic::Mutex for resources::x {
type T = u64;
fn lock<R>(&mut self, f: impl FnOnce(&mut u64) -> R) -> R {
@@ -161,7 +161,7 @@ In this particular example we could implement the critical section as follows:
> **NOTE:** this is a simplified implementation
``` rust
-impl rtfm::Mutex for resources::x {
+impl rtic::Mutex for resources::x {
type T = u64;
fn lock<R, F>(&mut self, f: F) -> R
@@ -224,7 +224,7 @@ provides extra information to the compiler.
Consider this program:
``` rust
-#[rtfm::app(device = ..)]
+#[rtic::app(device = ..)]
const APP: () = {
struct Resources {
#[init(0)]
@@ -235,7 +235,7 @@ const APP: () = {
#[init]
fn init() {
- rtfm::pend(Interrupt::UART0);
+ rtic::pend(Interrupt::UART0);
}
#[interrupt(binds = UART0, priority = 1, resources = [x, y])]
@@ -338,7 +338,7 @@ const APP: () = {
// similarly for `UART0` / `foo` and `UART2` / `baz`
- impl<'a> rtfm::Mutex for resources::x<'a> {
+ impl<'a> rtic::Mutex for resources::x<'a> {
type T = u64;
fn lock<R>(&mut self, f: impl FnOnce(&mut u64) -> R) -> R {
@@ -419,7 +419,7 @@ fn foo(c: foo::Context) {
## The BASEPRI invariant
-An invariant that the RTFM framework has to preserve is that the value of the
+An invariant that the RTIC framework has to preserve is that the value of the
BASEPRI at the start of an *interrupt* handler must be the same value it has
when the interrupt handler returns. BASEPRI may change during the execution of
the interrupt handler but running an interrupt handler from start to finish
@@ -429,7 +429,7 @@ This invariant needs to be preserved to avoid raising the dynamic priority of a
handler through preemption. This is best observed in the following example:
``` rust
-#[rtfm::app(device = ..)]
+#[rtic::app(device = ..)]
const APP: () = {
struct Resources {
#[init(0)]
@@ -439,7 +439,7 @@ const APP: () = {
#[init]
fn init() {
// `foo` will run right after `init` returns
- rtfm::pend(Interrupt::UART0);
+ rtic::pend(Interrupt::UART0);
}
#[task(binds = UART0, priority = 1)]
@@ -447,7 +447,7 @@ const APP: () = {
// BASEPRI is `0` at this point; the dynamic priority is currently `1`
// `bar` will preempt `foo` at this point
- rtfm::pend(Interrupt::UART1);
+ rtic::pend(Interrupt::UART1);
// BASEPRI is `192` at this point (due to a bug); the dynamic priority is now `2`
// this function returns to `idle`
@@ -472,7 +472,7 @@ const APP: () = {
// this has no effect due to the BASEPRI value
// the task `foo` will never be executed again
- rtfm::pend(Interrupt::UART0);
+ rtic::pend(Interrupt::UART0);
loop {
// ..
@@ -488,10 +488,10 @@ const APP: () = {
```
IMPORTANT: let's say we *forget* to roll back `BASEPRI` in `UART1` -- this would
-be a bug in the RTFM code generator.
+be a bug in the RTIC code generator.
``` rust
-// code generated by RTFM
+// code generated by RTIC
const APP: () = {
// ..