diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-09-05 14:57:05 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2025-09-05 14:57:05 +0200 |
| commit | 286d887529c66d8d1b4c7b56849e7a95386d79db (patch) | |
| tree | dc46ee5e7b8830d6836fc78864965b8e5b49aef5 | |
| parent | 70aaa82e490a8c5637de7e38cb636f04c1d187f7 (diff) | |
executor: always name main task `main`, not just with rtos-trace.
Also fixes the warning about the `rtos-trace` feature not existing in embassy-executor-macros.
| -rw-r--r-- | embassy-executor-macros/Cargo.toml | 1 | ||||
| -rw-r--r-- | embassy-executor-macros/src/macros/main.rs | 2 | ||||
| -rw-r--r-- | embassy-executor/CHANGELOG.md | 4 | ||||
| -rw-r--r-- | embassy-executor/Cargo.toml | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/embassy-executor-macros/Cargo.toml b/embassy-executor-macros/Cargo.toml index f803e6644..9c2b40d03 100644 --- a/embassy-executor-macros/Cargo.toml +++ b/embassy-executor-macros/Cargo.toml | |||
| @@ -23,3 +23,4 @@ proc-macro = true | |||
| 23 | 23 | ||
| 24 | [features] | 24 | [features] |
| 25 | nightly = [] | 25 | nightly = [] |
| 26 | metadata-name = [] | ||
diff --git a/embassy-executor-macros/src/macros/main.rs b/embassy-executor-macros/src/macros/main.rs index f043ff7f6..dc470e51c 100644 --- a/embassy-executor-macros/src/macros/main.rs +++ b/embassy-executor-macros/src/macros/main.rs | |||
| @@ -170,7 +170,7 @@ For example: `#[embassy_executor::main(entry = ..., executor = \"some_crate::Exe | |||
| 170 | let f_body = f.body; | 170 | let f_body = f.body; |
| 171 | let out = &f.sig.output; | 171 | let out = &f.sig.output; |
| 172 | 172 | ||
| 173 | let name_main_task = if cfg!(feature = "rtos-trace") { | 173 | let name_main_task = if cfg!(feature = "metadata-name") { |
| 174 | quote!( | 174 | quote!( |
| 175 | main_task.metadata().set_name("main\0"); | 175 | main_task.metadata().set_name("main\0"); |
| 176 | ) | 176 | ) |
diff --git a/embassy-executor/CHANGELOG.md b/embassy-executor/CHANGELOG.md index a36d270ba..dd462608b 100644 --- a/embassy-executor/CHANGELOG.md +++ b/embassy-executor/CHANGELOG.md | |||
| @@ -8,8 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 8 | <!-- next-header --> | 8 | <!-- next-header --> |
| 9 | ## Unreleased - ReleaseDate | 9 | ## Unreleased - ReleaseDate |
| 10 | 10 | ||
| 11 | - Added new metadata API for tasks | 11 | - Added new metadata API for tasks. |
| 12 | - Named main task when rtos-trace feature is enabled. | 12 | - Main task automatically gets a name of `main` when the `metadata-name` feature is enabled. |
| 13 | - Upgraded rtos-trace | 13 | - Upgraded rtos-trace |
| 14 | 14 | ||
| 15 | ## 0.9.1 - 2025-08-31 | 15 | ## 0.9.1 - 2025-08-31 |
diff --git a/embassy-executor/Cargo.toml b/embassy-executor/Cargo.toml index ed72a585f..7763adbe5 100644 --- a/embassy-executor/Cargo.toml +++ b/embassy-executor/Cargo.toml | |||
| @@ -112,7 +112,7 @@ arch-spin = ["_arch"] | |||
| 112 | #! ### Metadata | 112 | #! ### Metadata |
| 113 | 113 | ||
| 114 | ## Enable the `name` field in task metadata. | 114 | ## Enable the `name` field in task metadata. |
| 115 | metadata-name = [] | 115 | metadata-name = ["embassy-executor-macros/metadata-name"] |
| 116 | 116 | ||
| 117 | #! ### Executor | 117 | #! ### Executor |
| 118 | 118 | ||
