Skip to content

Commit 616962a

Browse files
Merge #254
254: Update RTFM name to RTIC, fixed links, updated singletons.md example. r=adamgreig a=PTaylor-us Co-authored-by: Peter Taylor <PTaylor@FluenTech.info>
2 parents ce72eb0 + df2f47c commit 616962a

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

src/concurrency/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,23 +555,23 @@ fn timer() {
555555
Whew! This is safe, but it is also a little unwieldy. Is there anything else
556556
we can do?
557557

558-
## RTFM
558+
## RTIC
559559

560-
One alternative is the [RTFM framework], short for Real Time For the Masses. It
560+
One alternative is the [RTIC framework], short for Real Time Interrupt-driven Concurrency. It
561561
enforces static priorities and tracks accesses to `static mut` variables
562562
("resources") to statically ensure that shared resources are always accessed
563563
safely, without requiring the overhead of always entering critical sections and
564564
using reference counting (as in `RefCell`). This has a number of advantages such
565565
as guaranteeing no deadlocks and giving extremely low time and memory overhead.
566566

567-
[RTFM framework]: https://github.com/japaric/cortex-m-rtfm
567+
[RTIC framework]: https://github.com/rtic-rs/cortex-m-rtic
568568

569569
The framework also includes other features like message passing, which reduces
570570
the need for explicit shared state, and the ability to schedule tasks to run at
571571
a given time, which can be used to implement periodic tasks. Check out [the
572572
documentation] for more information!
573573

574-
[the documentation]: https://japaric.github.io/cortex-m-rtfm/book/
574+
[the documentation]: https://rtic.rs
575575

576576
## Real Time Operating Systems
577577

src/peripherals/singletons.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,25 @@ fn main() {
7373

7474
[cortex_m docs](https://docs.rs/cortex-m/latest/cortex_m/macro.singleton.html)
7575

76-
Additionally, if you use `cortex-m-rtfm`, the entire process of defining and obtaining these peripherals are abstracted for you, and you are instead handed a `Peripherals` structure that contains a non-`Option<T>` version of all of the items you define.
76+
Additionally, if you use [`cortex-m-rtic`](https://github.com/rtic-rs/cortex-m-rtic), the entire process of defining and obtaining these peripherals are abstracted for you, and you are instead handed a `Peripherals` structure that contains a non-`Option<T>` version of all of the items you define.
7777

7878
```rust,ignore
79-
// cortex-m-rtfm v0.3.x
80-
app! {
81-
resources: {
82-
static RX: Rx<USART1>;
83-
static TX: Tx<USART1>;
79+
// cortex-m-rtic v0.5.x
80+
#[rtic::app(device = lm3s6965, peripherals = true)]
81+
const APP: () = {
82+
#[init]
83+
fn init(cx: init::Context) {
84+
static mut X: u32 = 0;
85+
86+
// Cortex-M peripherals
87+
let core: cortex_m::Peripherals = cx.core;
88+
89+
// Device specific peripherals
90+
let device: lm3s6965::Peripherals = cx.device;
8491
}
8592
}
86-
fn init(p: init::Peripherals) -> init::LateResources {
87-
// Note that this is now an owned value, not a reference
88-
let usart1: USART1 = p.device.USART1;
89-
}
9093
```
9194

92-
[japaric.io rtfm v3](https://blog.japaric.io/rtfm-v3/)
93-
9495
## But why?
9596

9697
But how do these Singletons make a noticeable difference in how our Rust code works?

0 commit comments

Comments
 (0)