Add support for Cortex-A/R

This commit is contained in:
Robin Mueller
2025-03-09 20:55:11 +01:00
parent f35aa4005a
commit 5a07ea5d85
10 changed files with 134 additions and 0 deletions

View File

@@ -70,6 +70,31 @@ pub fn main_cortex_m(args: TokenStream, item: TokenStream) -> TokenStream {
main::run(args.into(), item.into(), &main::ARCH_CORTEX_M).into()
}
/// Creates a new `executor` instance and declares an application entry point for Cortex-A/R
/// spawning the corresponding function body as an async task.
///
/// The following restrictions apply:
///
/// * The function must accept exactly 1 parameter, an `embassy_executor::Spawner` handle that it
/// can use to spawn additional tasks.
/// * The function must be declared `async`.
/// * The function must not use generics.
/// * Only a single `main` task may be declared.
///
/// ## Examples
/// Spawning a task:
///
/// ``` rust
/// #[embassy_executor::main]
/// async fn main(_s: embassy_executor::Spawner) {
/// // Function body
/// }
/// ```
#[proc_macro_attribute]
pub fn main_cortex_ar(args: TokenStream, item: TokenStream) -> TokenStream {
main::run(args.into(), item.into(), &main::ARCH_CORTEX_AR).into()
}
/// Creates a new `executor` instance and declares an architecture agnostic application entry point spawning
/// the corresponding function body as an async task.
///

View File

@@ -37,6 +37,12 @@ pub static ARCH_CORTEX_M: Arch = Arch {
executor_required: false,
};
pub static ARCH_CORTEX_AR: Arch = Arch {
default_entry: None,
flavor: Flavor::Standard,
executor_required: false,
};
pub static ARCH_SPIN: Arch = Arch {
default_entry: None,
flavor: Flavor::Standard,