aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-12-06 23:55:58 +0000
committerGitHub <[email protected]>2023-12-06 23:55:58 +0000
commit83138ce68e506692aabd825eae39016ddb8fd2c4 (patch)
tree6ac62c9f6d41e53d0f7f6d9737b1c0c206e531b3
parentad2d9040d9f36d2523a22752e98f24c661643cb7 (diff)
parentac2aec4e7a8e8a4c17c611810d382892398c9eb7 (diff)
Merge pull request #2262 from embassy-rs/executor-macros
executor: rename macro crate to embassy-executor-macros, bump it.
-rw-r--r--embassy-executor-macros/Cargo.toml (renamed from embassy-macros/Cargo.toml)4
-rw-r--r--embassy-executor-macros/README.md15
-rw-r--r--embassy-executor-macros/src/lib.rs (renamed from embassy-macros/src/lib.rs)0
-rw-r--r--embassy-executor-macros/src/macros/main.rs (renamed from embassy-macros/src/macros/main.rs)0
-rw-r--r--embassy-executor-macros/src/macros/mod.rs (renamed from embassy-macros/src/macros/mod.rs)0
-rw-r--r--embassy-executor-macros/src/macros/task.rs (renamed from embassy-macros/src/macros/task.rs)0
-rw-r--r--embassy-executor-macros/src/util/ctxt.rs (renamed from embassy-macros/src/util/ctxt.rs)0
-rw-r--r--embassy-executor-macros/src/util/mod.rs (renamed from embassy-macros/src/util/mod.rs)0
-rw-r--r--embassy-executor/Cargo.toml4
-rw-r--r--embassy-executor/src/arch/cortex_m.rs2
-rw-r--r--embassy-executor/src/arch/riscv32.rs2
-rw-r--r--embassy-executor/src/arch/std.rs2
-rw-r--r--embassy-executor/src/arch/wasm.rs2
-rw-r--r--embassy-executor/src/lib.rs2
-rw-r--r--embassy-executor/src/raw/mod.rs4
-rw-r--r--embassy-executor/src/spawner.rs4
-rw-r--r--embassy-macros/README.md21
17 files changed, 28 insertions, 34 deletions
diff --git a/embassy-macros/Cargo.toml b/embassy-executor-macros/Cargo.toml
index e13104cfd..6ea7ddb71 100644
--- a/embassy-macros/Cargo.toml
+++ b/embassy-executor-macros/Cargo.toml
@@ -1,6 +1,6 @@
1[package] 1[package]
2name = "embassy-macros" 2name = "embassy-executor-macros"
3version = "0.2.1" 3version = "0.4.0"
4edition = "2021" 4edition = "2021"
5license = "MIT OR Apache-2.0" 5license = "MIT OR Apache-2.0"
6description = "macros for creating the entry point and tasks for embassy-executor" 6description = "macros for creating the entry point and tasks for embassy-executor"
diff --git a/embassy-executor-macros/README.md b/embassy-executor-macros/README.md
new file mode 100644
index 000000000..a959c85d5
--- /dev/null
+++ b/embassy-executor-macros/README.md
@@ -0,0 +1,15 @@
1# embassy-executor-macros
2
3An [Embassy](https://embassy.dev) project.
4
5NOTE: Do not use this crate directly. The macros are re-exported by `embassy-executor`.
6
7## License
8
9This work is licensed under either of
10
11- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
12 <http://www.apache.org/licenses/LICENSE-2.0>)
13- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
14
15at your option.
diff --git a/embassy-macros/src/lib.rs b/embassy-executor-macros/src/lib.rs
index c9d58746a..c9d58746a 100644
--- a/embassy-macros/src/lib.rs
+++ b/embassy-executor-macros/src/lib.rs
diff --git a/embassy-macros/src/macros/main.rs b/embassy-executor-macros/src/macros/main.rs
index 3c0d58567..3c0d58567 100644
--- a/embassy-macros/src/macros/main.rs
+++ b/embassy-executor-macros/src/macros/main.rs
diff --git a/embassy-macros/src/macros/mod.rs b/embassy-executor-macros/src/macros/mod.rs
index 572094ca6..572094ca6 100644
--- a/embassy-macros/src/macros/mod.rs
+++ b/embassy-executor-macros/src/macros/mod.rs
diff --git a/embassy-macros/src/macros/task.rs b/embassy-executor-macros/src/macros/task.rs
index 5161e1020..5161e1020 100644
--- a/embassy-macros/src/macros/task.rs
+++ b/embassy-executor-macros/src/macros/task.rs
diff --git a/embassy-macros/src/util/ctxt.rs b/embassy-executor-macros/src/util/ctxt.rs
index 74c872c3c..74c872c3c 100644
--- a/embassy-macros/src/util/ctxt.rs
+++ b/embassy-executor-macros/src/util/ctxt.rs
diff --git a/embassy-macros/src/util/mod.rs b/embassy-executor-macros/src/util/mod.rs
index 28702809e..28702809e 100644
--- a/embassy-macros/src/util/mod.rs
+++ b/embassy-executor-macros/src/util/mod.rs
diff --git a/embassy-executor/Cargo.toml b/embassy-executor/Cargo.toml
index a79bd89f5..ec5aca46d 100644
--- a/embassy-executor/Cargo.toml
+++ b/embassy-executor/Cargo.toml
@@ -32,7 +32,7 @@ defmt = { version = "0.3", optional = true }
32log = { version = "0.4.14", optional = true } 32log = { version = "0.4.14", optional = true }
33rtos-trace = { version = "0.1.2", optional = true } 33rtos-trace = { version = "0.1.2", optional = true }
34 34
35embassy-macros = { version = "0.2.1", path = "../embassy-macros" } 35embassy-executor-macros = { version = "0.4.0", path = "../embassy-executor-macros" }
36embassy-time = { version = "0.2", path = "../embassy-time", optional = true} 36embassy-time = { version = "0.2", path = "../embassy-time", optional = true}
37critical-section = "1.1" 37critical-section = "1.1"
38 38
@@ -66,7 +66,7 @@ executor-thread = []
66executor-interrupt = [] 66executor-interrupt = []
67 67
68# Enable nightly-only features 68# Enable nightly-only features
69nightly = ["embassy-macros/nightly"] 69nightly = ["embassy-executor-macros/nightly"]
70 70
71turbowakers = [] 71turbowakers = []
72 72
diff --git a/embassy-executor/src/arch/cortex_m.rs b/embassy-executor/src/arch/cortex_m.rs
index 4a6d58575..5c517e0a2 100644
--- a/embassy-executor/src/arch/cortex_m.rs
+++ b/embassy-executor/src/arch/cortex_m.rs
@@ -51,7 +51,7 @@ mod thread {
51 use core::arch::asm; 51 use core::arch::asm;
52 use core::marker::PhantomData; 52 use core::marker::PhantomData;
53 53
54 pub use embassy_macros::main_cortex_m as main; 54 pub use embassy_executor_macros::main_cortex_m as main;
55 55
56 use crate::{raw, Spawner}; 56 use crate::{raw, Spawner};
57 57
diff --git a/embassy-executor/src/arch/riscv32.rs b/embassy-executor/src/arch/riscv32.rs
index ca12c3403..c56f502d3 100644
--- a/embassy-executor/src/arch/riscv32.rs
+++ b/embassy-executor/src/arch/riscv32.rs
@@ -7,7 +7,7 @@ pub use thread::*;
7mod thread { 7mod thread {
8 use core::marker::PhantomData; 8 use core::marker::PhantomData;
9 9
10 pub use embassy_macros::main_riscv as main; 10 pub use embassy_executor_macros::main_riscv as main;
11 use portable_atomic::{AtomicBool, Ordering}; 11 use portable_atomic::{AtomicBool, Ordering};
12 12
13 use crate::{raw, Spawner}; 13 use crate::{raw, Spawner};
diff --git a/embassy-executor/src/arch/std.rs b/embassy-executor/src/arch/std.rs
index 598bb0509..b02b15988 100644
--- a/embassy-executor/src/arch/std.rs
+++ b/embassy-executor/src/arch/std.rs
@@ -8,7 +8,7 @@ mod thread {
8 use std::marker::PhantomData; 8 use std::marker::PhantomData;
9 use std::sync::{Condvar, Mutex}; 9 use std::sync::{Condvar, Mutex};
10 10
11 pub use embassy_macros::main_std as main; 11 pub use embassy_executor_macros::main_std as main;
12 12
13 use crate::{raw, Spawner}; 13 use crate::{raw, Spawner};
14 14
diff --git a/embassy-executor/src/arch/wasm.rs b/embassy-executor/src/arch/wasm.rs
index 3faa92575..f9d0f935c 100644
--- a/embassy-executor/src/arch/wasm.rs
+++ b/embassy-executor/src/arch/wasm.rs
@@ -8,7 +8,7 @@ mod thread {
8 8
9 use core::marker::PhantomData; 9 use core::marker::PhantomData;
10 10
11 pub use embassy_macros::main_wasm as main; 11 pub use embassy_executor_macros::main_wasm as main;
12 use js_sys::Promise; 12 use js_sys::Promise;
13 use wasm_bindgen::prelude::*; 13 use wasm_bindgen::prelude::*;
14 14
diff --git a/embassy-executor/src/lib.rs b/embassy-executor/src/lib.rs
index 897696150..4c6900a6d 100644
--- a/embassy-executor/src/lib.rs
+++ b/embassy-executor/src/lib.rs
@@ -6,7 +6,7 @@
6// This mod MUST go first, so that the others see its macros. 6// This mod MUST go first, so that the others see its macros.
7pub(crate) mod fmt; 7pub(crate) mod fmt;
8 8
9pub use embassy_macros::task; 9pub use embassy_executor_macros::task;
10 10
11macro_rules! check_at_most_one { 11macro_rules! check_at_most_one {
12 (@amo [$($feats:literal)*] [] [$($res:tt)*]) => { 12 (@amo [$($feats:literal)*] [] [$($res:tt)*]) => {
diff --git a/embassy-executor/src/raw/mod.rs b/embassy-executor/src/raw/mod.rs
index e9137f8fa..b16a1c7c3 100644
--- a/embassy-executor/src/raw/mod.rs
+++ b/embassy-executor/src/raw/mod.rs
@@ -5,7 +5,7 @@
5//! ## WARNING: here be dragons! 5//! ## WARNING: here be dragons!
6//! 6//!
7//! Using this module requires respecting subtle safety contracts. If you can, prefer using the safe 7//! Using this module requires respecting subtle safety contracts. If you can, prefer using the safe
8//! [executor wrappers](crate::Executor) and the [`embassy_executor::task`](embassy_macros::task) macro, which are fully safe. 8//! [executor wrappers](crate::Executor) and the [`embassy_executor::task`](embassy_executor_macros::task) macro, which are fully safe.
9 9
10#[cfg_attr(target_has_atomic = "ptr", path = "run_queue_atomics.rs")] 10#[cfg_attr(target_has_atomic = "ptr", path = "run_queue_atomics.rs")]
11#[cfg_attr(not(target_has_atomic = "ptr"), path = "run_queue_critical_section.rs")] 11#[cfg_attr(not(target_has_atomic = "ptr"), path = "run_queue_critical_section.rs")]
@@ -97,7 +97,7 @@ impl TaskRef {
97/// A `TaskStorage` must live forever, it may not be deallocated even after the task has finished 97/// A `TaskStorage` must live forever, it may not be deallocated even after the task has finished
98/// running. Hence the relevant methods require `&'static self`. It may be reused, however. 98/// running. Hence the relevant methods require `&'static self`. It may be reused, however.
99/// 99///
100/// Internally, the [embassy_executor::task](embassy_macros::task) macro allocates an array of `TaskStorage`s 100/// Internally, the [embassy_executor::task](embassy_executor_macros::task) macro allocates an array of `TaskStorage`s
101/// in a `static`. The most common reason to use the raw `Task` is to have control of where 101/// in a `static`. The most common reason to use the raw `Task` is to have control of where
102/// the memory for the task is allocated: on the stack, or on the heap with e.g. `Box::leak`, etc. 102/// the memory for the task is allocated: on the stack, or on the heap with e.g. `Box::leak`, etc.
103 103
diff --git a/embassy-executor/src/spawner.rs b/embassy-executor/src/spawner.rs
index 5a3a0dee1..271606244 100644
--- a/embassy-executor/src/spawner.rs
+++ b/embassy-executor/src/spawner.rs
@@ -115,9 +115,9 @@ impl Spawner {
115 } 115 }
116 } 116 }
117 117
118 // Used by the `embassy_macros::main!` macro to throw an error when spawn 118 // Used by the `embassy_executor_macros::main!` macro to throw an error when spawn
119 // fails. This is here to allow conditional use of `defmt::unwrap!` 119 // fails. This is here to allow conditional use of `defmt::unwrap!`
120 // without introducing a `defmt` feature in the `embassy_macros` package, 120 // without introducing a `defmt` feature in the `embassy_executor_macros` package,
121 // which would require use of `-Z namespaced-features`. 121 // which would require use of `-Z namespaced-features`.
122 /// Spawn a task into an executor, panicking on failure. 122 /// Spawn a task into an executor, panicking on failure.
123 /// 123 ///
diff --git a/embassy-macros/README.md b/embassy-macros/README.md
deleted file mode 100644
index d1d6f4cc4..000000000
--- a/embassy-macros/README.md
+++ /dev/null
@@ -1,21 +0,0 @@
1# embassy-macros
2
3An [Embassy](https://embassy.dev) project.
4
5Macros for creating the main entry point and tasks that can be spawned by `embassy-executor`.
6
7NOTE: The macros are re-exported by the `embassy-executor` crate which should be used instead of adding a direct dependency on the `embassy-macros` crate.
8
9## Minimum supported Rust version (MSRV)
10
11The `task` and `main` macros require the type alias impl trait (TAIT) nightly feature in order to compile.
12
13## License
14
15This work is licensed under either of
16
17- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
18 <http://www.apache.org/licenses/LICENSE-2.0>)
19- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
20
21at your option.