aboutsummaryrefslogtreecommitdiff
path: root/book/en/deprecated
diff options
context:
space:
mode:
authordatdenkikniet <jcdra1@gmail.com>2023-04-23 15:33:56 +0200
committerdatdenkikniet <jcdra1@gmail.com>2023-05-11 19:20:58 +0200
commita66540efa014b3716d252612bfc7f8f17ed765c4 (patch)
tree5efe4cf769b9941c5ce387649ee8ed15470ca507 /book/en/deprecated
parent0807aa548c865d12746ce17aa1c17f7968b139a9 (diff)
Disable the playground on all of these
Diffstat (limited to 'book/en/deprecated')
-rw-r--r--book/en/deprecated/by_example/monotonic.md4
-rw-r--r--book/en/deprecated/migration/migration_rtic.md2
-rw-r--r--book/en/deprecated/migration/migration_v4.md16
-rw-r--r--book/en/deprecated/migration/migration_v5.md36
4 files changed, 29 insertions, 29 deletions
diff --git a/book/en/deprecated/by_example/monotonic.md b/book/en/deprecated/by_example/monotonic.md
index 3a23681..0ed4340 100644
--- a/book/en/deprecated/by_example/monotonic.md
+++ b/book/en/deprecated/by_example/monotonic.md
@@ -34,7 +34,7 @@ This activates the monotonics making it possible to use them.
See the following example:
-``` rust
+``` rust,noplayground
{{#include ../../../../examples/schedule.rs}}
```
@@ -54,7 +54,7 @@ which allows canceling or rescheduling of the task scheduled to run in the futur
If `cancel` or `reschedule_at`/`reschedule_after` returns an `Err` it means that the operation was
too late and that the task is already sent for execution. The following example shows this in action:
-``` rust
+``` rust,noplayground
{{#include ../../../../examples/cancel-reschedule.rs}}
```
diff --git a/book/en/deprecated/migration/migration_rtic.md b/book/en/deprecated/migration/migration_rtic.md
index c027da3..e079cbf 100644
--- a/book/en/deprecated/migration/migration_rtic.md
+++ b/book/en/deprecated/migration/migration_rtic.md
@@ -27,7 +27,7 @@ cortex-m-rtic = "0.5.3"
The only code change that needs to be made is that any reference to `rtfm` before now need to point
to `rtic` as follows:
-``` rust
+``` rust,noplayground
//
// Change this
//
diff --git a/book/en/deprecated/migration/migration_v4.md b/book/en/deprecated/migration/migration_v4.md
index d1a7ebe..f28b6d9 100644
--- a/book/en/deprecated/migration/migration_v4.md
+++ b/book/en/deprecated/migration/migration_v4.md
@@ -42,7 +42,7 @@ framework: `resources`, `spawn`, `schedule` -- these variables will become
fields of the `Context` structure. Each function within the `#[rtfm::app]` item
gets a different `Context` type.
-``` rust
+``` rust,noplayground
#[rtfm::app(/* .. */)]
const APP: () = {
// change this
@@ -90,7 +90,7 @@ const APP: () = {
The syntax used to declare resources has changed from `static mut`
variables to a `struct Resources`.
-``` rust
+``` rust,noplayground
#[rtfm::app(/* .. */)]
const APP: () = {
// change this
@@ -118,7 +118,7 @@ the `device` field of the `init::Context` structure.
Change this:
-``` rust
+``` rust,noplayground
#[rtfm::app(/* .. */)]
const APP: () = {
#[init]
@@ -132,7 +132,7 @@ const APP: () = {
Into this:
-``` rust
+``` rust,noplayground
#[rtfm::app(/* .. */, peripherals = true)]
// ^^^^^^^^^^^^^^^^^^
const APP: () = {
@@ -155,7 +155,7 @@ attribute with the `binds` argument instead.
Change this:
-``` rust
+``` rust,noplayground
#[rtfm::app(/* .. */)]
const APP: () = {
// hardware tasks
@@ -175,7 +175,7 @@ const APP: () = {
Into this:
-``` rust
+``` rust,noplayground
#[rtfm::app(/* .. */)]
const APP: () = {
#[task(binds = SVCall)]
@@ -212,7 +212,7 @@ ensure it is enabled by the application inside `init`.
Change this:
-``` rust
+``` rust,noplayground
use rtfm::{Duration, Instant, U32Ext};
#[rtfm::app(/* .. */)]
@@ -226,7 +226,7 @@ const APP: () = {
Into this:
-``` rust
+``` rust,noplayground
use rtfm::cyccnt::{Duration, Instant, U32Ext};
// ^^^^^^^^
diff --git a/book/en/deprecated/migration/migration_v5.md b/book/en/deprecated/migration/migration_v5.md
index 5a8fabc..1b4fa0d 100644
--- a/book/en/deprecated/migration/migration_v5.md
+++ b/book/en/deprecated/migration/migration_v5.md
@@ -12,7 +12,7 @@ With the support of attributes on modules the `const APP` workaround is not need
Change
-``` rust
+``` rust,noplayground
#[rtic::app(/* .. */)]
const APP: () = {
[code here]
@@ -21,7 +21,7 @@ const APP: () = {
into
-``` rust
+``` rust,noplayground
#[rtic::app(/* .. */)]
mod app {
[code here]
@@ -75,7 +75,7 @@ mod app {
Change
-``` rust
+``` rust,noplayground
#[rtic::app(/* .. */)]
const APP: () = {
[code here]
@@ -92,7 +92,7 @@ const APP: () = {
into
-``` rust
+``` rust,noplayground
#[rtic::app(/* .. */, dispatchers = [SSI0, QEI0])]
mod app {
[code here]
@@ -106,7 +106,7 @@ This works also for ram functions, see examples/ramfunc.rs
Previously the RTIC resources had to be in in a struct named exactly "Resources":
-``` rust
+``` rust,noplayground
struct Resources {
// Resources defined in here
}
@@ -115,7 +115,7 @@ struct Resources {
With RTIC v1.0.0 the resources structs are annotated similarly like
`#[task]`, `#[init]`, `#[idle]`: with the attributes `#[shared]` and `#[local]`
-``` rust
+``` rust,noplayground
#[shared]
struct MySharedResources {
// Resources shared between tasks are defined here
@@ -136,7 +136,7 @@ In v1.0.0 resources are split between `shared` resources and `local` resources.
In v0.5.x:
-``` rust
+``` rust,noplayground
struct Resources {
local_to_b: i64,
shared_by_a_and_b: i64,
@@ -151,7 +151,7 @@ fn b(_: b::Context) {}
In v1.0.0:
-``` rust
+``` rust,noplayground
#[shared]
struct Shared {
shared_by_a_and_b: i64,
@@ -176,7 +176,7 @@ to be used for all `shared` resource access.
In old code one could do the following as the high priority
task has exclusive access to the resource:
-``` rust
+``` rust,noplayground
#[task(priority = 2, resources = [r])]
fn foo(cx: foo::Context) {
cx.resources.r = /* ... */;
@@ -190,7 +190,7 @@ fn bar(cx: bar::Context) {
And with symmetric locks one needs to use locks in both tasks:
-``` rust
+``` rust,noplayground
#[task(priority = 2, shared = [r])]
fn foo(cx: foo::Context) {
cx.shared.r.lock(|r| r = /* ... */);
@@ -211,7 +211,7 @@ This is still possible in 1.0: the `#[shared]` resource must be annotated with t
v0.5 code:
-``` rust
+``` rust,noplayground
struct Resources {
counter: u64,
}
@@ -229,7 +229,7 @@ fn b(cx: b::Context) {
v1.0 code:
-``` rust
+``` rust,noplayground
#[shared]
struct Shared {
#[lock_free]
@@ -254,7 +254,7 @@ Instead of that syntax, use the `local` argument in `#[init]`.
v0.5.x code:
-``` rust
+``` rust,noplayground
#[init]
fn init(_: init::Context) {
static mut BUFFER: [u8; 1024] = [0; 1024];
@@ -264,7 +264,7 @@ fn init(_: init::Context) {
v1.0.0 code:
-``` rust
+``` rust,noplayground
#[init(local = [
buffer: [u8; 1024] = [0; 1024]
// type ^^^^^^^^^^^^ ^^^^^^^^^ initial value
@@ -282,7 +282,7 @@ In order to make the API more symmetric the #[init]-task always returns a late r
From this:
-``` rust
+``` rust,noplayground
#[rtic::app(device = lm3s6965)]
const APP: () = {
#[init]
@@ -296,7 +296,7 @@ const APP: () = {
to this:
-``` rust
+``` rust,noplayground
#[rtic::app(device = lm3s6965)]
mod app {
#[shared]
@@ -321,7 +321,7 @@ mod app {
With the new spawn/spawn_after/spawn_at interface,
old code requiring the context `cx` for spawning such as:
-``` rust
+``` rust,noplayground
#[task(spawn = [bar])]
fn foo(cx: foo::Context) {
cx.spawn.bar().unwrap();
@@ -335,7 +335,7 @@ fn bar(cx: bar::Context) {
Will now be written as:
-``` rust
+``` rust,noplayground
#[task]
fn foo(_c: foo::Context) {
bar::spawn().unwrap();