diff options
| author | Dion Dokter <[email protected]> | 2024-08-05 11:21:21 +0200 |
|---|---|---|
| committer | Dion Dokter <[email protected]> | 2024-08-05 11:21:21 +0200 |
| commit | ab4d378dda5a74834dcc1fc0c872824f4a616911 (patch) | |
| tree | d79824af61988c9adae883fa04e40b7b74e112a9 /embassy-executor | |
| parent | 2a7fe16ceb53aca38f73ac01a923ea445654673c (diff) | |
| parent | 0f685761e09b1617e435de4e50986fe9a548502e (diff) | |
Merge branch 'master' into stm-dualcore
Diffstat (limited to 'embassy-executor')
| -rw-r--r-- | embassy-executor/CHANGELOG.md | 6 | ||||
| -rw-r--r-- | embassy-executor/Cargo.toml | 4 | ||||
| -rw-r--r-- | embassy-executor/build_common.rs | 21 | ||||
| -rw-r--r-- | embassy-executor/src/fmt.rs | 16 |
4 files changed, 15 insertions, 32 deletions
diff --git a/embassy-executor/CHANGELOG.md b/embassy-executor/CHANGELOG.md index 77c64fd8e..5582b56ec 100644 --- a/embassy-executor/CHANGELOG.md +++ b/embassy-executor/CHANGELOG.md | |||
| @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 7 | 7 | ||
| 8 | ## Unreleased | 8 | ## Unreleased |
| 9 | 9 | ||
| 10 | ## 0.6.0 - 2024-08-05 | ||
| 11 | |||
| 12 | - Add collapse_debuginfo to fmt.rs macros. | ||
| 13 | - initial support for avr | ||
| 14 | - use nightly waker_getters APIs | ||
| 15 | |||
| 10 | ## 0.5.0 - 2024-01-11 | 16 | ## 0.5.0 - 2024-01-11 |
| 11 | 17 | ||
| 12 | - Updated to `embassy-time-driver 0.1`, `embassy-time-queue-driver 0.1`, compatible with `embassy-time v0.3` and higher. | 18 | - Updated to `embassy-time-driver 0.1`, `embassy-time-queue-driver 0.1`, compatible with `embassy-time v0.3` and higher. |
diff --git a/embassy-executor/Cargo.toml b/embassy-executor/Cargo.toml index 431165cee..5984cc49c 100644 --- a/embassy-executor/Cargo.toml +++ b/embassy-executor/Cargo.toml | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | [package] | 1 | [package] |
| 2 | name = "embassy-executor" | 2 | name = "embassy-executor" |
| 3 | version = "0.5.0" | 3 | version = "0.6.0" |
| 4 | edition = "2021" | 4 | edition = "2021" |
| 5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
| 6 | description = "async/await executor designed for embedded usage" | 6 | description = "async/await executor designed for embedded usage" |
| @@ -33,7 +33,7 @@ defmt = { version = "0.3", optional = true } | |||
| 33 | log = { version = "0.4.14", optional = true } | 33 | log = { version = "0.4.14", optional = true } |
| 34 | rtos-trace = { version = "0.1.2", optional = true } | 34 | rtos-trace = { version = "0.1.2", optional = true } |
| 35 | 35 | ||
| 36 | embassy-executor-macros = { version = "0.4.0", path = "../embassy-executor-macros" } | 36 | embassy-executor-macros = { version = "0.5.0", path = "../embassy-executor-macros" } |
| 37 | embassy-time-driver = { version = "0.1.0", path = "../embassy-time-driver", optional = true } | 37 | embassy-time-driver = { version = "0.1.0", path = "../embassy-time-driver", optional = true } |
| 38 | embassy-time-queue-driver = { version = "0.1.0", path = "../embassy-time-queue-driver", optional = true } | 38 | embassy-time-queue-driver = { version = "0.1.0", path = "../embassy-time-queue-driver", optional = true } |
| 39 | critical-section = "1.1" | 39 | critical-section = "1.1" |
diff --git a/embassy-executor/build_common.rs b/embassy-executor/build_common.rs index 0487eb3c5..4f24e6d37 100644 --- a/embassy-executor/build_common.rs +++ b/embassy-executor/build_common.rs | |||
| @@ -8,8 +8,6 @@ | |||
| 8 | 8 | ||
| 9 | use std::collections::HashSet; | 9 | use std::collections::HashSet; |
| 10 | use std::env; | 10 | use std::env; |
| 11 | use std::ffi::OsString; | ||
| 12 | use std::process::Command; | ||
| 13 | 11 | ||
| 14 | /// Helper for emitting cargo instruction for enabling configs (`cargo:rustc-cfg=X`) and declaring | 12 | /// Helper for emitting cargo instruction for enabling configs (`cargo:rustc-cfg=X`) and declaring |
| 15 | /// them (`cargo:rust-check-cfg=cfg(X)`). | 13 | /// them (`cargo:rust-check-cfg=cfg(X)`). |
| @@ -17,7 +15,6 @@ use std::process::Command; | |||
| 17 | pub struct CfgSet { | 15 | pub struct CfgSet { |
| 18 | enabled: HashSet<String>, | 16 | enabled: HashSet<String>, |
| 19 | declared: HashSet<String>, | 17 | declared: HashSet<String>, |
| 20 | emit_declared: bool, | ||
| 21 | } | 18 | } |
| 22 | 19 | ||
| 23 | impl CfgSet { | 20 | impl CfgSet { |
| @@ -25,7 +22,6 @@ impl CfgSet { | |||
| 25 | Self { | 22 | Self { |
| 26 | enabled: HashSet::new(), | 23 | enabled: HashSet::new(), |
| 27 | declared: HashSet::new(), | 24 | declared: HashSet::new(), |
| 28 | emit_declared: is_rustc_nightly(), | ||
| 29 | } | 25 | } |
| 30 | } | 26 | } |
| 31 | 27 | ||
| @@ -49,7 +45,7 @@ impl CfgSet { | |||
| 49 | /// | 45 | /// |
| 50 | /// This enables rustc to check that the configs in `#[cfg(...)]` attributes are valid. | 46 | /// This enables rustc to check that the configs in `#[cfg(...)]` attributes are valid. |
| 51 | pub fn declare(&mut self, cfg: impl AsRef<str>) { | 47 | pub fn declare(&mut self, cfg: impl AsRef<str>) { |
| 52 | if self.declared.insert(cfg.as_ref().to_owned()) && self.emit_declared { | 48 | if self.declared.insert(cfg.as_ref().to_owned()) { |
| 53 | println!("cargo:rustc-check-cfg=cfg({})", cfg.as_ref()); | 49 | println!("cargo:rustc-check-cfg=cfg({})", cfg.as_ref()); |
| 54 | } | 50 | } |
| 55 | } | 51 | } |
| @@ -69,21 +65,6 @@ impl CfgSet { | |||
| 69 | } | 65 | } |
| 70 | } | 66 | } |
| 71 | 67 | ||
| 72 | fn is_rustc_nightly() -> bool { | ||
| 73 | if env::var_os("EMBASSY_FORCE_CHECK_CFG").is_some() { | ||
| 74 | return true; | ||
| 75 | } | ||
| 76 | |||
| 77 | let rustc = env::var_os("RUSTC").unwrap_or_else(|| OsString::from("rustc")); | ||
| 78 | |||
| 79 | let output = Command::new(rustc) | ||
| 80 | .arg("--version") | ||
| 81 | .output() | ||
| 82 | .expect("failed to run `rustc --version`"); | ||
| 83 | |||
| 84 | String::from_utf8_lossy(&output.stdout).contains("nightly") | ||
| 85 | } | ||
| 86 | |||
| 87 | /// Sets configs that describe the target platform. | 68 | /// Sets configs that describe the target platform. |
| 88 | pub fn set_target_cfgs(cfgs: &mut CfgSet) { | 69 | pub fn set_target_cfgs(cfgs: &mut CfgSet) { |
| 89 | let target = env::var("TARGET").unwrap(); | 70 | let target = env::var("TARGET").unwrap(); |
diff --git a/embassy-executor/src/fmt.rs b/embassy-executor/src/fmt.rs index 35b929fde..8ca61bc39 100644 --- a/embassy-executor/src/fmt.rs +++ b/embassy-executor/src/fmt.rs | |||
| @@ -90,19 +90,15 @@ macro_rules! todo { | |||
| 90 | }; | 90 | }; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | #[cfg(not(feature = "defmt"))] | ||
| 94 | #[collapse_debuginfo(yes)] | ||
| 95 | macro_rules! unreachable { | ||
| 96 | ($($x:tt)*) => { | ||
| 97 | ::core::unreachable!($($x)*) | ||
| 98 | }; | ||
| 99 | } | ||
| 100 | |||
| 101 | #[cfg(feature = "defmt")] | ||
| 102 | #[collapse_debuginfo(yes)] | 93 | #[collapse_debuginfo(yes)] |
| 103 | macro_rules! unreachable { | 94 | macro_rules! unreachable { |
| 104 | ($($x:tt)*) => { | 95 | ($($x:tt)*) => { |
| 105 | ::defmt::unreachable!($($x)*) | 96 | { |
| 97 | #[cfg(not(feature = "defmt"))] | ||
| 98 | ::core::unreachable!($($x)*); | ||
| 99 | #[cfg(feature = "defmt")] | ||
| 100 | ::defmt::unreachable!($($x)*); | ||
| 101 | } | ||
| 106 | }; | 102 | }; |
| 107 | } | 103 | } |
| 108 | 104 | ||
