aboutsummaryrefslogtreecommitdiff
path: root/docs/modules
diff options
context:
space:
mode:
authorErik Bånvik <[email protected]>2024-03-03 01:27:52 +0100
committerGitHub <[email protected]>2024-03-03 01:27:52 +0100
commitf45116884285bd5609bbd1f771e1bb42edfb8d90 (patch)
tree08edb6bb8aa7be74583a532feeb08f264b2f7372 /docs/modules
parent047b20cee42e4438bcf054c4f94812c4895508e7 (diff)
parent64890498ca6d6193ca0ac30952c24a657b8b88f3 (diff)
Merge branch 'embassy-rs:main' into feat/radio-ieee802154
Diffstat (limited to 'docs/modules')
-rw-r--r--docs/modules/ROOT/pages/basic_application.adoc15
1 files changed, 3 insertions, 12 deletions
diff --git a/docs/modules/ROOT/pages/basic_application.adoc b/docs/modules/ROOT/pages/basic_application.adoc
index 95792d5a0..d5aad806d 100644
--- a/docs/modules/ROOT/pages/basic_application.adoc
+++ b/docs/modules/ROOT/pages/basic_application.adoc
@@ -17,22 +17,13 @@ The first thing you’ll notice are two attributes at the top of the file. These
17include::example$basic/src/main.rs[lines="1..2"] 17include::example$basic/src/main.rs[lines="1..2"]
18---- 18----
19 19
20=== Rust Nightly
21
22The next declaration is a Rust Unstable feature, which means that Embassy requires Rust Nightly:
23
24[source,rust]
25----
26include::example$basic/src/main.rs[lines="3"]
27----
28
29=== Dealing with errors 20=== Dealing with errors
30 21
31Then, what follows are some declarations on how to deal with panics and faults. During development, a good practice is to rely on `defmt-rtt` and `panic-probe` to print diagnostics to the terminal: 22Then, what follows are some declarations on how to deal with panics and faults. During development, a good practice is to rely on `defmt-rtt` and `panic-probe` to print diagnostics to the terminal:
32 23
33[source,rust] 24[source,rust]
34---- 25----
35include::example$basic/src/main.rs[lines="10"] 26include::example$basic/src/main.rs[lines="8"]
36---- 27----
37 28
38=== Task declaration 29=== Task declaration
@@ -41,7 +32,7 @@ After a bit of import declaration, the tasks run by the application should be de
41 32
42[source,rust] 33[source,rust]
43---- 34----
44include::example$basic/src/main.rs[lines="12..20"] 35include::example$basic/src/main.rs[lines="10..18"]
45---- 36----
46 37
47An embassy task must be declared `async`, and may NOT take generic arguments. In this case, we are handed the LED that should be blinked and the interval of the blinking. 38An embassy task must be declared `async`, and may NOT take generic arguments. In this case, we are handed the LED that should be blinked and the interval of the blinking.
@@ -56,7 +47,7 @@ We then initialize the HAL with a default config, which gives us a `Peripherals`
56 47
57[source,rust] 48[source,rust]
58---- 49----
59include::example$basic/src/main.rs[lines="22..-1"] 50include::example$basic/src/main.rs[lines="20..-1"]
60---- 51----
61 52
62What happens when the `blinker` task has been spawned and main returns? Well, the main entry point is actually just like any other task, except that you can only have one and it takes some specific type arguments. The magic lies within the `#[embassy_executor::main]` macro. The macro does the following: 53What happens when the `blinker` task has been spawned and main returns? Well, the main entry point is actually just like any other task, except that you can only have one and it takes some specific type arguments. The magic lies within the `#[embassy_executor::main]` macro. The macro does the following: