588: Highlight how to run examples locally r=perlindgren a=AfoHT

How examples are run never gets properly introduced before used in `by-example/resources.md`

Fixes #587 

Co-authored-by: Henrik Tjäder <henrik@grepit.se>
This commit is contained in:
bors[bot] 2022-01-22 22:07:37 +00:00 committed by GitHub
commit 69cacd0597
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View file

@ -15,3 +15,18 @@ Check [the embedded Rust book] for instructions on how to set up an
embedded development environment that includes QEMU. embedded development environment that includes QEMU.
[the embedded Rust book]: https://rust-embedded.github.io/book/intro/install.html [the embedded Rust book]: https://rust-embedded.github.io/book/intro/install.html
To run the examples found in `examples/` locally, cargo needs a supported `target` and
either `--examples` (run all examples) or `--example NAME` to run a specific example.
Assuming dependencies in place, running:
``` console
$ cargo run --target thumbv7m-none-eabi --example locals
```
Yields this output:
``` console
{{#include ../../../ci/expected/locals.run}}
```

View file

@ -37,6 +37,8 @@ The example application shown below contains two tasks where each task has acces
{{#include ../../../../examples/locals.rs}} {{#include ../../../../examples/locals.rs}}
``` ```
Running the example:
``` console ``` console
$ cargo run --target thumbv7m-none-eabi --example locals $ cargo run --target thumbv7m-none-eabi --example locals
{{#include ../../../../ci/expected/locals.run}} {{#include ../../../../ci/expected/locals.run}}