aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor
diff options
context:
space:
mode:
authorDion Dokter <[email protected]>2024-08-05 11:21:21 +0200
committerDion Dokter <[email protected]>2024-08-05 11:21:21 +0200
commitab4d378dda5a74834dcc1fc0c872824f4a616911 (patch)
treed79824af61988c9adae883fa04e40b7b74e112a9 /embassy-executor
parent2a7fe16ceb53aca38f73ac01a923ea445654673c (diff)
parent0f685761e09b1617e435de4e50986fe9a548502e (diff)
Merge branch 'master' into stm-dualcore
Diffstat (limited to 'embassy-executor')
-rw-r--r--embassy-executor/CHANGELOG.md6
-rw-r--r--embassy-executor/Cargo.toml4
-rw-r--r--embassy-executor/build_common.rs21
-rw-r--r--embassy-executor/src/fmt.rs16
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]
2name = "embassy-executor" 2name = "embassy-executor"
3version = "0.5.0" 3version = "0.6.0"
4edition = "2021" 4edition = "2021"
5license = "MIT OR Apache-2.0" 5license = "MIT OR Apache-2.0"
6description = "async/await executor designed for embedded usage" 6description = "async/await executor designed for embedded usage"
@@ -33,7 +33,7 @@ defmt = { version = "0.3", optional = true }
33log = { version = "0.4.14", optional = true } 33log = { version = "0.4.14", optional = true }
34rtos-trace = { version = "0.1.2", optional = true } 34rtos-trace = { version = "0.1.2", optional = true }
35 35
36embassy-executor-macros = { version = "0.4.0", path = "../embassy-executor-macros" } 36embassy-executor-macros = { version = "0.5.0", path = "../embassy-executor-macros" }
37embassy-time-driver = { version = "0.1.0", path = "../embassy-time-driver", optional = true } 37embassy-time-driver = { version = "0.1.0", path = "../embassy-time-driver", optional = true }
38embassy-time-queue-driver = { version = "0.1.0", path = "../embassy-time-queue-driver", optional = true } 38embassy-time-queue-driver = { version = "0.1.0", path = "../embassy-time-queue-driver", optional = true }
39critical-section = "1.1" 39critical-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
9use std::collections::HashSet; 9use std::collections::HashSet;
10use std::env; 10use std::env;
11use std::ffi::OsString;
12use 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;
17pub struct CfgSet { 15pub 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
23impl CfgSet { 20impl 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
72fn 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.
88pub fn set_target_cfgs(cfgs: &mut CfgSet) { 69pub 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)]
95macro_rules! unreachable {
96 ($($x:tt)*) => {
97 ::core::unreachable!($($x)*)
98 };
99}
100
101#[cfg(feature = "defmt")]
102#[collapse_debuginfo(yes)] 93#[collapse_debuginfo(yes)]
103macro_rules! unreachable { 94macro_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