aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-11-23 13:21:59 +0000
committerGitHub <[email protected]>2022-11-23 13:21:59 +0000
commita4f9e7cbcc8cb3ff679b4677a85a06d514b0c465 (patch)
treeacb48252c134b900eca51299995e84a95fbd0cd3 /embassy-executor/src
parentde95ab264d8ee2bf5ba9c3615ecb1b44e3940694 (diff)
parent04a7d976733e021395ff26e26dfa983e67b773a0 (diff)
Merge #1071
1071: refactor: autodetect macro variant r=Dirbaio a=lulf Apply heuristics using target_arch, target_os and target_family to determine which variant of the entry point to use. Co-authored-by: Ulf Lilleengen <[email protected]>
Diffstat (limited to 'embassy-executor/src')
-rw-r--r--embassy-executor/src/lib.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/embassy-executor/src/lib.rs b/embassy-executor/src/lib.rs
index e4cbd04b9..4c7e2f4cd 100644
--- a/embassy-executor/src/lib.rs
+++ b/embassy-executor/src/lib.rs
@@ -8,18 +8,22 @@
8pub(crate) mod fmt; 8pub(crate) mod fmt;
9 9
10#[cfg(feature = "nightly")] 10#[cfg(feature = "nightly")]
11pub use embassy_macros::{main, task}; 11pub use embassy_macros::task;
12 12
13cfg_if::cfg_if! { 13cfg_if::cfg_if! {
14 if #[cfg(cortex_m)] { 14 if #[cfg(cortex_m)] {
15 #[path="arch/cortex_m.rs"] 15 #[path="arch/cortex_m.rs"]
16 mod arch; 16 mod arch;
17 pub use arch::*; 17 pub use arch::*;
18 #[cfg(feature = "nightly")]
19 pub use embassy_macros::main_cortex_m as main;
18 } 20 }
19 else if #[cfg(target_arch="riscv32")] { 21 else if #[cfg(target_arch="riscv32")] {
20 #[path="arch/riscv32.rs"] 22 #[path="arch/riscv32.rs"]
21 mod arch; 23 mod arch;
22 pub use arch::*; 24 pub use arch::*;
25 #[cfg(feature = "nightly")]
26 pub use embassy_macros::main_riscv as main;
23 } 27 }
24 else if #[cfg(all(target_arch="xtensa", feature = "nightly"))] { 28 else if #[cfg(all(target_arch="xtensa", feature = "nightly"))] {
25 #[path="arch/xtensa.rs"] 29 #[path="arch/xtensa.rs"]
@@ -30,11 +34,15 @@ cfg_if::cfg_if! {
30 #[path="arch/wasm.rs"] 34 #[path="arch/wasm.rs"]
31 mod arch; 35 mod arch;
32 pub use arch::*; 36 pub use arch::*;
37 #[cfg(feature = "nightly")]
38 pub use embassy_macros::main_wasm as main;
33 } 39 }
34 else if #[cfg(feature="std")] { 40 else if #[cfg(feature="std")] {
35 #[path="arch/std.rs"] 41 #[path="arch/std.rs"]
36 mod arch; 42 mod arch;
37 pub use arch::*; 43 pub use arch::*;
44 #[cfg(feature = "nightly")]
45 pub use embassy_macros::main_std as main;
38 } 46 }
39} 47}
40 48