Skip to content

Commit b9c58d2

Browse files
committed
Disable the playground on all of these
1 parent bc3971b commit b9c58d2

30 files changed

+103
-103
lines changed

book/en/deprecated/by_example/monotonic.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This activates the monotonics making it possible to use them.
3434

3535
See the following example:
3636

37-
``` rust
37+
``` rust,noplayground
3838
{{#include ../../../../examples/schedule.rs}}
3939
```
4040

@@ -54,7 +54,7 @@ which allows canceling or rescheduling of the task scheduled to run in the futur
5454
If `cancel` or `reschedule_at`/`reschedule_after` returns an `Err` it means that the operation was
5555
too late and that the task is already sent for execution. The following example shows this in action:
5656

57-
``` rust
57+
``` rust,noplayground
5858
{{#include ../../../../examples/cancel-reschedule.rs}}
5959
```
6060

book/en/deprecated/migration/migration_rtic.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ cortex-m-rtic = "0.5.3"
2727
The only code change that needs to be made is that any reference to `rtfm` before now need to point
2828
to `rtic` as follows:
2929

30-
``` rust
30+
``` rust,noplayground
3131
//
3232
// Change this
3333
//

book/en/deprecated/migration/migration_v4.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ framework: `resources`, `spawn`, `schedule` -- these variables will become
4242
fields of the `Context` structure. Each function within the `#[rtfm::app]` item
4343
gets a different `Context` type.
4444

45-
``` rust
45+
``` rust,noplayground
4646
#[rtfm::app(/* .. */)]
4747
const APP: () = {
4848
// change this
@@ -90,7 +90,7 @@ const APP: () = {
9090
The syntax used to declare resources has changed from `static mut`
9191
variables to a `struct Resources`.
9292

93-
``` rust
93+
``` rust,noplayground
9494
#[rtfm::app(/* .. */)]
9595
const APP: () = {
9696
// change this
@@ -118,7 +118,7 @@ the `device` field of the `init::Context` structure.
118118

119119
Change this:
120120

121-
``` rust
121+
``` rust,noplayground
122122
#[rtfm::app(/* .. */)]
123123
const APP: () = {
124124
#[init]
@@ -132,7 +132,7 @@ const APP: () = {
132132

133133
Into this:
134134

135-
``` rust
135+
``` rust,noplayground
136136
#[rtfm::app(/* .. */, peripherals = true)]
137137
// ^^^^^^^^^^^^^^^^^^
138138
const APP: () = {
@@ -155,7 +155,7 @@ attribute with the `binds` argument instead.
155155

156156
Change this:
157157

158-
``` rust
158+
``` rust,noplayground
159159
#[rtfm::app(/* .. */)]
160160
const APP: () = {
161161
// hardware tasks
@@ -175,7 +175,7 @@ const APP: () = {
175175

176176
Into this:
177177

178-
``` rust
178+
``` rust,noplayground
179179
#[rtfm::app(/* .. */)]
180180
const APP: () = {
181181
#[task(binds = SVCall)]
@@ -212,7 +212,7 @@ ensure it is enabled by the application inside `init`.
212212

213213
Change this:
214214

215-
``` rust
215+
``` rust,noplayground
216216
use rtfm::{Duration, Instant, U32Ext};
217217
218218
#[rtfm::app(/* .. */)]
@@ -226,7 +226,7 @@ const APP: () = {
226226

227227
Into this:
228228

229-
``` rust
229+
``` rust,noplayground
230230
use rtfm::cyccnt::{Duration, Instant, U32Ext};
231231
// ^^^^^^^^
232232

book/en/deprecated/migration/migration_v5.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ With the support of attributes on modules the `const APP` workaround is not need
1212

1313
Change
1414

15-
``` rust
15+
``` rust,noplayground
1616
#[rtic::app(/* .. */)]
1717
const APP: () = {
1818
[code here]
@@ -21,7 +21,7 @@ const APP: () = {
2121

2222
into
2323

24-
``` rust
24+
``` rust,noplayground
2525
#[rtic::app(/* .. */)]
2626
mod app {
2727
[code here]
@@ -75,7 +75,7 @@ mod app {
7575

7676
Change
7777

78-
``` rust
78+
``` rust,noplayground
7979
#[rtic::app(/* .. */)]
8080
const APP: () = {
8181
[code here]
@@ -92,7 +92,7 @@ const APP: () = {
9292

9393
into
9494

95-
``` rust
95+
``` rust,noplayground
9696
#[rtic::app(/* .. */, dispatchers = [SSI0, QEI0])]
9797
mod app {
9898
[code here]
@@ -106,7 +106,7 @@ This works also for ram functions, see examples/ramfunc.rs
106106

107107
Previously the RTIC resources had to be in in a struct named exactly "Resources":
108108

109-
``` rust
109+
``` rust,noplayground
110110
struct Resources {
111111
// Resources defined in here
112112
}
@@ -115,7 +115,7 @@ struct Resources {
115115
With RTIC v1.0.0 the resources structs are annotated similarly like
116116
`#[task]`, `#[init]`, `#[idle]`: with the attributes `#[shared]` and `#[local]`
117117

118-
``` rust
118+
``` rust,noplayground
119119
#[shared]
120120
struct MySharedResources {
121121
// Resources shared between tasks are defined here
@@ -136,7 +136,7 @@ In v1.0.0 resources are split between `shared` resources and `local` resources.
136136

137137
In v0.5.x:
138138

139-
``` rust
139+
``` rust,noplayground
140140
struct Resources {
141141
local_to_b: i64,
142142
shared_by_a_and_b: i64,
@@ -151,7 +151,7 @@ fn b(_: b::Context) {}
151151

152152
In v1.0.0:
153153

154-
``` rust
154+
``` rust,noplayground
155155
#[shared]
156156
struct Shared {
157157
shared_by_a_and_b: i64,
@@ -176,7 +176,7 @@ to be used for all `shared` resource access.
176176
In old code one could do the following as the high priority
177177
task has exclusive access to the resource:
178178

179-
``` rust
179+
``` rust,noplayground
180180
#[task(priority = 2, resources = [r])]
181181
fn foo(cx: foo::Context) {
182182
cx.resources.r = /* ... */;
@@ -190,7 +190,7 @@ fn bar(cx: bar::Context) {
190190

191191
And with symmetric locks one needs to use locks in both tasks:
192192

193-
``` rust
193+
``` rust,noplayground
194194
#[task(priority = 2, shared = [r])]
195195
fn foo(cx: foo::Context) {
196196
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
211211

212212
v0.5 code:
213213

214-
``` rust
214+
``` rust,noplayground
215215
struct Resources {
216216
counter: u64,
217217
}
@@ -229,7 +229,7 @@ fn b(cx: b::Context) {
229229

230230
v1.0 code:
231231

232-
``` rust
232+
``` rust,noplayground
233233
#[shared]
234234
struct Shared {
235235
#[lock_free]
@@ -254,7 +254,7 @@ Instead of that syntax, use the `local` argument in `#[init]`.
254254

255255
v0.5.x code:
256256

257-
``` rust
257+
``` rust,noplayground
258258
#[init]
259259
fn init(_: init::Context) {
260260
static mut BUFFER: [u8; 1024] = [0; 1024];
@@ -264,7 +264,7 @@ fn init(_: init::Context) {
264264

265265
v1.0.0 code:
266266

267-
``` rust
267+
``` rust,noplayground
268268
#[init(local = [
269269
buffer: [u8; 1024] = [0; 1024]
270270
// type ^^^^^^^^^^^^ ^^^^^^^^^ initial value
@@ -282,7 +282,7 @@ In order to make the API more symmetric the #[init]-task always returns a late r
282282

283283
From this:
284284

285-
``` rust
285+
``` rust,noplayground
286286
#[rtic::app(device = lm3s6965)]
287287
const APP: () = {
288288
#[init]
@@ -296,7 +296,7 @@ const APP: () = {
296296

297297
to this:
298298

299-
``` rust
299+
``` rust,noplayground
300300
#[rtic::app(device = lm3s6965)]
301301
mod app {
302302
#[shared]
@@ -321,7 +321,7 @@ mod app {
321321
With the new spawn/spawn_after/spawn_at interface,
322322
old code requiring the context `cx` for spawning such as:
323323

324-
``` rust
324+
``` rust,noplayground
325325
#[task(spawn = [bar])]
326326
fn foo(cx: foo::Context) {
327327
cx.spawn.bar().unwrap();
@@ -335,7 +335,7 @@ fn bar(cx: bar::Context) {
335335

336336
Will now be written as:
337337

338-
``` rust
338+
``` rust,noplayground
339339
#[task]
340340
fn foo(_c: foo::Context) {
341341
bar::spawn().unwrap();

book/en/src/by-example/app.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ Overall, the generated code infers no additional overhead in comparison to a han
2727
To give a flavour of RTIC, the following example contains commonly used features.
2828
In the following sections we will go through each feature in detail.
2929

30-
``` rust
30+
``` rust,noplayground
3131
{{#include ../../../../rtic/examples/common.rs}}
3232
```

book/en/src/by-example/app_idle.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Like in `init`, locally declared resources will have `'static` lifetimes that ar
1111

1212
The example below shows that `idle` runs after `init`.
1313

14-
``` rust
14+
``` rust,noplayground
1515
{{#include ../../../../rtic/examples/idle.rs}}
1616
```
1717

@@ -38,7 +38,7 @@ The following example shows how to enable sleep by setting the
3838
[WFI]: https://developer.arm.com/documentation/dui0662/b/The-Cortex-M0--Instruction-Set/Miscellaneous-instructions/WFI
3939
[NOP]: https://developer.arm.com/documentation/dui0662/b/The-Cortex-M0--Instruction-Set/Miscellaneous-instructions/NOP
4040

41-
``` rust
41+
``` rust,noplayground
4242
{{#include ../../../../rtic/examples/idle-wfi.rs}}
4343
```
4444

book/en/src/by-example/app_init.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The example below shows the types of the `core`, `device` and `cs` fields, and s
1616
The `device` field is only available when the `peripherals` argument is set to the default value `true`.
1717
In the rare case you want to implement an ultra-slim application you can explicitly set `peripherals` to `false`.
1818

19-
``` rust
19+
``` rust,noplayground
2020
{{#include ../../../../rtic/examples/init.rs}}
2121
```
2222

book/en/src/by-example/app_minimal.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is the smallest possible RTIC application:
44

5-
``` rust
5+
``` rust,noplayground
66
{{#include ../../../../rtic/examples/smallest.rs}}
77
```
88

book/en/src/by-example/app_priorities.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Task Priority
3333

3434
The following example showcases the priority based scheduling of tasks:
3535

36-
``` rust
36+
``` rust,noplayground
3737
{{#include ../../../../rtic/examples/preempt.rs}}
3838
```
3939

book/en/src/by-example/channel.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Channels can be used to communicate data between running tasks. The channel is essentially a wait queue, allowing tasks with multiple producers and a single receiver. A channel is constructed in the `init` task and backed by statically allocated memory. Send and receive endpoints are distributed to *software* tasks:
44

5-
``` rust
5+
``` rust,noplayground
66
...
77
const CAPACITY: usize = 5;
88
#[init]
@@ -22,7 +22,7 @@ Channels can also be used from *hardware* tasks, but only in a non-`async` manne
2222

2323
The `send` method post a message on the channel as shown below:
2424

25-
``` rust
25+
``` rust,noplayground
2626
#[task]
2727
async fn sender1(_c: sender1::Context, mut sender: Sender<'static, u32, CAPACITY>) {
2828
hprintln!("Sender 1 sending: 1");
@@ -34,7 +34,7 @@ async fn sender1(_c: sender1::Context, mut sender: Sender<'static, u32, CAPACITY
3434

3535
The receiver can `await` incoming messages:
3636

37-
``` rust
37+
``` rust,noplayground
3838
#[task]
3939
async fn receiver(_c: receiver::Context, mut receiver: Receiver<'static, u32, CAPACITY>) {
4040
while let Ok(val) = receiver.recv().await {
@@ -48,7 +48,7 @@ Channels are implemented using a small (global) *Critical Section* (CS) for prot
4848

4949
For a complete example:
5050

51-
``` rust
51+
``` rust,noplayground
5252
{{#include ../../../../rtic/examples/async-channel.rs}}
5353
```
5454

@@ -64,7 +64,7 @@ Also sender endpoint can be awaited. In case the channel capacity has not yet be
6464

6565
In the following example the `CAPACITY` has been reduced to 1, forcing sender tasks to wait until the data in the channel has been received.
6666

67-
``` rust
67+
``` rust,noplayground
6868
{{#include ../../../../rtic/examples/async-channel-done.rs}}
6969
```
7070

@@ -81,7 +81,7 @@ $ cargo run --target thumbv7m-none-eabi --example async-channel-done --features
8181

8282
In case all senders have been dropped `await`-ing on an empty receiver channel results in an error. This allows to gracefully implement different types of shutdown operations.
8383

84-
``` rust
84+
``` rust,noplayground
8585
{{#include ../../../../rtic/examples/async-channel-no-sender.rs}}
8686
```
8787

@@ -97,7 +97,7 @@ Similarly, `await`-ing on a send channel results in an error in case the receive
9797

9898
The resulting error returns the data back to the sender, allowing the sender to take appropriate action (e.g., storing the data to later retry sending it).
9999

100-
``` rust
100+
``` rust,noplayground
101101
{{#include ../../../../rtic/examples/async-channel-no-receiver.rs}}
102102
```
103103

@@ -115,7 +115,7 @@ Using the Try API, you can send or receive data from or to a channel without req
115115

116116
This API is exposed through `Receiver::try_recv` and `Sender::try_send`.
117117

118-
``` rust
118+
``` rust,noplayground
119119
{{#include ../../../../rtic/examples/async-channel-try.rs}}
120120
```
121121

0 commit comments

Comments
 (0)