summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorUlf Lilleengen <ulf.lilleengen@gmail.com>2021-12-10 12:58:23 +0100
committerUlf Lilleengen <ulf.lilleengen@gmail.com>2021-12-10 12:58:23 +0100
commitaa0abe976a481b0fb58d6bdee5d448658e6f8ffc (patch)
tree5b44c88091681ccac8a8990b3ad94c2e960ea933 /docs
parente5d4d0952b78ef343f14205f5ebd3f1d7804f9e8 (diff)
downloadembassy-aa0abe976a481b0fb58d6bdee5d448658e6f8ffc.zip
Fix doc example compile
Diffstat (limited to 'docs')
-rw-r--r--docs/modules/ROOT/examples/basic/Cargo.toml5
-rw-r--r--docs/modules/ROOT/examples/basic/src/main.rs7
-rw-r--r--docs/modules/ROOT/pages/basic_application.adoc6
3 files changed, 10 insertions, 8 deletions
diff --git a/docs/modules/ROOT/examples/basic/Cargo.toml b/docs/modules/ROOT/examples/basic/Cargo.toml
index a683a28b..0f1c30da 100644
--- a/docs/modules/ROOT/examples/basic/Cargo.toml
+++ b/docs/modules/ROOT/examples/basic/Cargo.toml
@@ -5,9 +5,8 @@ name = "embassy-basic-example"
version = "0.1.0"
[dependencies]
-embassy = { version = "0.1.0", path = "../../../../embassy", features = ["defmt"] }
-embassy-traits = { version = "0.1.0", path = "../../../../embassy-traits", features = ["defmt"] }
-embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] }
+embassy = { version = "0.1.0", path = "../../../../../embassy", features = ["defmt"] }
+embassy-nrf = { version = "0.1.0", path = "../../../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] }
defmt = "0.3"
defmt-rtt = "0.3"
diff --git a/docs/modules/ROOT/examples/basic/src/main.rs b/docs/modules/ROOT/examples/basic/src/main.rs
index 0152b40b..2a9b1fac 100644
--- a/docs/modules/ROOT/examples/basic/src/main.rs
+++ b/docs/modules/ROOT/examples/basic/src/main.rs
@@ -9,8 +9,11 @@ use defmt::*;
use embassy::executor::Spawner;
use embassy::time::{Duration, Timer};
-use embassy_nrf::gpio::{Level, Output, OutputDrive};
-use embassy_nrf::Peripherals;
+use embassy_nrf::{
+ gpio::{Level, Output, OutputDrive},
+ peripherals::P0_13,
+ Peripherals,
+};
use embedded_hal::digital::v2::OutputPin;
#[embassy::task]
diff --git a/docs/modules/ROOT/pages/basic_application.adoc b/docs/modules/ROOT/pages/basic_application.adoc
index c2849927..46a375c8 100644
--- a/docs/modules/ROOT/pages/basic_application.adoc
+++ b/docs/modules/ROOT/pages/basic_application.adoc
@@ -30,7 +30,7 @@ After a bit of import declaration, the tasks run by the application should be de
[source,rust]
----
-include::example$basic/src/main.rs[lines="16..24"]
+include::example$basic/src/main.rs[lines="18..27"]
----
An 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.
@@ -45,7 +45,7 @@ The `Spawner` is the way the main application spawns other tasks. The `Periphera
[source,rust]
----
-include::example$basic/src/main.rs[lines="26..30"]
+include::example$basic/src/main.rs[lines="28..-1"]
----
@@ -64,7 +64,7 @@ The project definition needs to contain the embassy dependencies:
[source,toml]
----
-include::example$basic/Cargo.toml[lines="8..10"]
+include::example$basic/Cargo.toml[lines="8..9"]
----
Depending on your microcontroller, you may need to replace `embassy-nrf` with something else (`embassy-stm32` for STM32. Remember to update feature flags as well).