Add support for Cortex-A/R
This commit is contained in:
@@ -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.
|
||||
///
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user