aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorckrenslehner <[email protected]>2024-10-25 20:36:46 +0200
committerGitHub <[email protected]>2024-10-25 20:36:46 +0200
commit2c05ac5262eb2beaa043818f02d82b656f272b4f (patch)
tree32b5a53414fe2728453f19d6657a3aeda6644ac0 /docs
parent6bcd05ac830bbeaaa09776a397477ee4022c3499 (diff)
Update embassy Cargo.toml section in new_project.adoc
Embassy is already published to crates.io 🍾
Diffstat (limited to 'docs')
-rw-r--r--docs/pages/new_project.adoc18
1 files changed, 15 insertions, 3 deletions
diff --git a/docs/pages/new_project.adoc b/docs/pages/new_project.adoc
index 821bcbd27..fa4c2e359 100644
--- a/docs/pages/new_project.adoc
+++ b/docs/pages/new_project.adoc
@@ -73,16 +73,28 @@ Now that cargo knows what target to compile for (and probe-rs knows what chip to
73 73
74Looking in `examples/stm32g4/Cargo.toml`, we can see that the examples require a number of embassy crates. For blinky, we’ll only need three of them: `embassy-stm32`, `embassy-executor` and `embassy-time`. 74Looking in `examples/stm32g4/Cargo.toml`, we can see that the examples require a number of embassy crates. For blinky, we’ll only need three of them: `embassy-stm32`, `embassy-executor` and `embassy-time`.
75 75
76At the time of writing, the latest version of embassy isn‘t available on crates.io, so we need to install it straight from the git repository. The recommended way of doing so is as follows: 76
77At the time of writing, embassy is already published to crates.io. Therefore, dependencies can easily added via Cargo.toml.
78
79[source,toml]
80----
81[dependencies]
82embassy-stm32 = { version = "0.1.0", features = ["defmt", "time-driver-any", "stm32g474re", "memory-x", "unstable-pac", "exti"] }
83embassy-executor = { version = "0.6.1", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
84embassy-time = { version = "0.3.2", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
85----
86
87Prior embassy needed to be installed straight from the git repository. This can is still useful, if you want to checkout a specic revision of an embassy crate which is not yet published.
88The recommended way of doing so is as follows:
77 89
78* Copy the required `embassy-*` lines from the example `Cargo.toml` 90* Copy the required `embassy-*` lines from the example `Cargo.toml`
79* Make any necessary changes to `features`, e.g. requiring the `stm32g474re` feature of `embassy-stm32` 91* Make any necessary changes to `features`, e.g. requiring the `stm32g474re` feature of `embassy-stm32`
80* Remove the `path = ""` keys in the `embassy-*` entries 92* Remove the `path = ""` keys in the `embassy-*` entries
81* Create a `[patch.crates-io]` section, with entries for each embassy crate we need. These should all contain identical values: a link to the git repository, and a reference to the commit we’re checking out. Assuming you want the latest commit, you can find it by running `git ls-remote https://github.com/embassy-rs/embassy.git HEAD` 93* Create a `[patch.crates-io]` section, with entries for each embassy crate we need. These should all contain identical values: a link to the git repository, and a reference to the commit we’re checking out. Assuming you want the latest commit, you can find it by running `git ls-remote https://github.com/embassy-rs/embassy.git HEAD`
82 94
83NOTE: When using this method, it’s necessary that the `version` keys in `[dependencies]` match up with the versions defined in each crate’s `Cargo.toml` in the specificed `rev` under `[patch.crates.io]`. This means that when updating, you have to a pick a new revision, change everything in `[patch.crates.io]` to match it, and then correct any versions under `[dependencies]` which have changed. Hopefully this will no longer be necessary once embassy is released on crates.io! 95NOTE: When using this method, it’s necessary that the `version` keys in `[dependencies]` match up with the versions defined in each crate’s `Cargo.toml` in the specificed `rev` under `[patch.crates.io]`. This means that when updating, you have to a pick a new revision, change everything in `[patch.crates.io]` to match it, and then correct any versions under `[dependencies]` which have changed.
84 96
85At the time of writing, this method produces the following results: 97An example Cargo.toml file might look as follows:
86 98
87[source,toml] 99[source,toml]
88---- 100----