aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2024-02-09 08:46:03 +0000
committerGitHub <[email protected]>2024-02-09 08:46:03 +0000
commit460cf79513d7fbcd7910ea96dbcaf320d97f593e (patch)
tree6aab6bd8d55ae8d4ad1f7267cf75bef851f3a8a0 /docs
parentb326ee19bbd65e553e6891c08f623e5acdd95375 (diff)
parentcbdc49ef8d92606f917d1df0d88e4baef7bb23df (diff)
Merge pull request #2548 from plaes/faq-fixes
Faq fixes due to embassy-time crate split
Diffstat (limited to 'docs')
-rw-r--r--docs/modules/ROOT/pages/best_practices.adoc6
-rw-r--r--docs/modules/ROOT/pages/faq.adoc12
2 files changed, 11 insertions, 7 deletions
diff --git a/docs/modules/ROOT/pages/best_practices.adoc b/docs/modules/ROOT/pages/best_practices.adoc
index 1e02f9ba9..bfcedec06 100644
--- a/docs/modules/ROOT/pages/best_practices.adoc
+++ b/docs/modules/ROOT/pages/best_practices.adoc
@@ -3,8 +3,10 @@
3Over time, a couple of best practices have emerged. The following list should serve as a guideline for developers writing embedded software in _Rust_, especially in the context of the _Embassy_ framework. 3Over time, a couple of best practices have emerged. The following list should serve as a guideline for developers writing embedded software in _Rust_, especially in the context of the _Embassy_ framework.
4 4
5== Passing Buffers by Reference 5== Passing Buffers by Reference
6It may be tempting to pass arrays or wrappers, like link:https://docs.rs/heapless/latest/heapless/[`heapless::Vec`], to a function or return one just like you would with a `std::Vec`. However, in most embedded applications you don't want to spend ressources on an allocator and end up placing buffers on the stack. 6It may be tempting to pass arrays or wrappers, like link:https://docs.rs/heapless/latest/heapless/[`heapless::Vec`],
7This, however, can easily blow up your stack if you are not careful. 7to a function or return one just like you would with a `std::Vec`. However, in most embedded applications you don't
8want to spend resources on an allocator and end up placing buffers on the stack. This, however, can easily blow up
9your stack if you are not careful.
8 10
9Consider the following example: 11Consider the following example:
10[,rust] 12[,rust]
diff --git a/docs/modules/ROOT/pages/faq.adoc b/docs/modules/ROOT/pages/faq.adoc
index 05ff7c598..7fb81e2ca 100644
--- a/docs/modules/ROOT/pages/faq.adoc
+++ b/docs/modules/ROOT/pages/faq.adoc
@@ -29,11 +29,10 @@ If you see an error like this:
29 29
30You are likely missing some features of the `embassy-executor` crate. 30You are likely missing some features of the `embassy-executor` crate.
31 31
32For Cortex-M targets, consider making sure that ALL of the following features are active in your `Cargo.toml` for the `embassy-executor` crate: 32For Cortex-M targets, check whether ALL of the following features are enabled in your `Cargo.toml` for the `embassy-executor` crate:
33 33
34* `arch-cortex-m` 34* `arch-cortex-m`
35* `executor-thread` 35* `executor-thread`
36* `nightly`
37 36
38For ESP32, consider using the executors and `#[main]` macro provided by your appropriate link:https://crates.io/crates/esp-hal-common[HAL crate]. 37For ESP32, consider using the executors and `#[main]` macro provided by your appropriate link:https://crates.io/crates/esp-hal-common[HAL crate].
39 38
@@ -125,15 +124,18 @@ You have multiple versions of the same crate in your dependency tree. This means
125embassy crates are coming from crates.io, and some from git, each of them pulling in a different set 124embassy crates are coming from crates.io, and some from git, each of them pulling in a different set
126of dependencies. 125of dependencies.
127 126
128To resolve this issue, make sure to only use a single source for all your embassy crates! To do this, 127To resolve this issue, make sure to only use a single source for all your embassy crates!
129you should patch your dependencies to use git sources using `[patch.crates.io]` and maybe `[patch.'https://github.com/embassy-rs/embassy.git']`. 128To do this, you should patch your dependencies to use git sources using `[patch.crates.io]`
129and maybe `[patch.'https://github.com/embassy-rs/embassy.git']`.
130 130
131Example: 131Example:
132 132
133[source,toml] 133[source,toml]
134---- 134----
135[patch.crates-io] 135[patch.crates-io]
136embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "e5fdd35" } 136embassy-time-queue-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "e5fdd35" }
137embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "e5fdd35" }
138# embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "e5fdd35" }
137---- 139----
138 140
139Note that the git revision should match any other embassy patches or git dependencies that you are using! 141Note that the git revision should match any other embassy patches or git dependencies that you are using!