diff options
| author | Ulf Lilleengen <[email protected]> | 2021-12-10 12:58:23 +0100 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2021-12-10 12:58:23 +0100 |
| commit | aa0abe976a481b0fb58d6bdee5d448658e6f8ffc (patch) | |
| tree | 5b44c88091681ccac8a8990b3ad94c2e960ea933 | |
| parent | e5d4d0952b78ef343f14205f5ebd3f1d7804f9e8 (diff) | |
Fix doc example compile
| -rw-r--r-- | docs/modules/ROOT/examples/basic/Cargo.toml | 5 | ||||
| -rw-r--r-- | docs/modules/ROOT/examples/basic/src/main.rs | 7 | ||||
| -rw-r--r-- | docs/modules/ROOT/pages/basic_application.adoc | 6 |
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 a683a28bf..0f1c30da3 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" | |||
| 5 | version = "0.1.0" | 5 | version = "0.1.0" |
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy = { version = "0.1.0", path = "../../../../embassy", features = ["defmt"] } | 8 | embassy = { version = "0.1.0", path = "../../../../../embassy", features = ["defmt"] } |
| 9 | embassy-traits = { version = "0.1.0", path = "../../../../embassy-traits", features = ["defmt"] } | 9 | embassy-nrf = { version = "0.1.0", path = "../../../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } |
| 10 | embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } | ||
| 11 | 10 | ||
| 12 | defmt = "0.3" | 11 | defmt = "0.3" |
| 13 | defmt-rtt = "0.3" | 12 | 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 0152b40bb..2a9b1facc 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::*; | |||
| 9 | 9 | ||
| 10 | use embassy::executor::Spawner; | 10 | use embassy::executor::Spawner; |
| 11 | use embassy::time::{Duration, Timer}; | 11 | use embassy::time::{Duration, Timer}; |
| 12 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 12 | use embassy_nrf::{ |
| 13 | use embassy_nrf::Peripherals; | 13 | gpio::{Level, Output, OutputDrive}, |
| 14 | peripherals::P0_13, | ||
| 15 | Peripherals, | ||
| 16 | }; | ||
| 14 | use embedded_hal::digital::v2::OutputPin; | 17 | use embedded_hal::digital::v2::OutputPin; |
| 15 | 18 | ||
| 16 | #[embassy::task] | 19 | #[embassy::task] |
diff --git a/docs/modules/ROOT/pages/basic_application.adoc b/docs/modules/ROOT/pages/basic_application.adoc index c2849927a..46a375c86 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 | |||
| 30 | 30 | ||
| 31 | [source,rust] | 31 | [source,rust] |
| 32 | ---- | 32 | ---- |
| 33 | include::example$basic/src/main.rs[lines="16..24"] | 33 | include::example$basic/src/main.rs[lines="18..27"] |
| 34 | ---- | 34 | ---- |
| 35 | 35 | ||
| 36 | 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. | 36 | 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 | |||
| 45 | 45 | ||
| 46 | [source,rust] | 46 | [source,rust] |
| 47 | ---- | 47 | ---- |
| 48 | include::example$basic/src/main.rs[lines="26..30"] | 48 | include::example$basic/src/main.rs[lines="28..-1"] |
| 49 | ---- | 49 | ---- |
| 50 | 50 | ||
| 51 | 51 | ||
| @@ -64,7 +64,7 @@ The project definition needs to contain the embassy dependencies: | |||
| 64 | 64 | ||
| 65 | [source,toml] | 65 | [source,toml] |
| 66 | ---- | 66 | ---- |
| 67 | include::example$basic/Cargo.toml[lines="8..10"] | 67 | include::example$basic/Cargo.toml[lines="8..9"] |
| 68 | ---- | 68 | ---- |
| 69 | 69 | ||
| 70 | 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). | 70 | 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). |
