diff options
| author | Robin Mueller <[email protected]> | 2025-03-09 20:55:11 +0100 |
|---|---|---|
| committer | Robin Mueller <[email protected]> | 2025-05-28 17:00:42 +0200 |
| commit | 5a07ea5d851768223e2e41342e69d14c1afb2b2b (patch) | |
| tree | a9b6980ee1c3301bef0dc7c8d287add2ed4a43a8 /embassy-executor-macros/src/lib.rs | |
| parent | f35aa4005a63e8d478b2b95aaa2bfb316b72dece (diff) | |
Add support for Cortex-A/R
Diffstat (limited to 'embassy-executor-macros/src/lib.rs')
| -rw-r--r-- | embassy-executor-macros/src/lib.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/embassy-executor-macros/src/lib.rs b/embassy-executor-macros/src/lib.rs index 8e737db6a..962ce2e75 100644 --- a/embassy-executor-macros/src/lib.rs +++ b/embassy-executor-macros/src/lib.rs | |||
| @@ -70,6 +70,31 @@ pub fn main_cortex_m(args: TokenStream, item: TokenStream) -> TokenStream { | |||
| 70 | main::run(args.into(), item.into(), &main::ARCH_CORTEX_M).into() | 70 | main::run(args.into(), item.into(), &main::ARCH_CORTEX_M).into() |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | /// Creates a new `executor` instance and declares an application entry point for Cortex-A/R | ||
| 74 | /// spawning the corresponding function body as an async task. | ||
| 75 | /// | ||
| 76 | /// The following restrictions apply: | ||
| 77 | /// | ||
| 78 | /// * The function must accept exactly 1 parameter, an `embassy_executor::Spawner` handle that it | ||
| 79 | /// can use to spawn additional tasks. | ||
| 80 | /// * The function must be declared `async`. | ||
| 81 | /// * The function must not use generics. | ||
| 82 | /// * Only a single `main` task may be declared. | ||
| 83 | /// | ||
| 84 | /// ## Examples | ||
| 85 | /// Spawning a task: | ||
| 86 | /// | ||
| 87 | /// ``` rust | ||
| 88 | /// #[embassy_executor::main] | ||
| 89 | /// async fn main(_s: embassy_executor::Spawner) { | ||
| 90 | /// // Function body | ||
| 91 | /// } | ||
| 92 | /// ``` | ||
| 93 | #[proc_macro_attribute] | ||
| 94 | pub fn main_cortex_ar(args: TokenStream, item: TokenStream) -> TokenStream { | ||
| 95 | main::run(args.into(), item.into(), &main::ARCH_CORTEX_AR).into() | ||
| 96 | } | ||
| 97 | |||
| 73 | /// Creates a new `executor` instance and declares an architecture agnostic application entry point spawning | 98 | /// Creates a new `executor` instance and declares an architecture agnostic application entry point spawning |
| 74 | /// the corresponding function body as an async task. | 99 | /// the corresponding function body as an async task. |
| 75 | /// | 100 | /// |
