Add embassy-cortex-m crate.
- Move Interrupt and InterruptExecutor from `embassy` to `embassy-cortex-m`. - Move Unborrow from `embassy` to `embassy-hal-common` (nothing in `embassy` requires it anymore) - Move PeripheralMutex from `embassy-hal-common` to `embassy-cortex-m`.
This commit is contained in:
@ -22,16 +22,20 @@ pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
|
||||
}
|
||||
|
||||
#[proc_macro_attribute]
|
||||
pub fn interrupt(args: TokenStream, item: TokenStream) -> TokenStream {
|
||||
pub fn cortex_m_interrupt(args: TokenStream, item: TokenStream) -> TokenStream {
|
||||
let args = syn::parse_macro_input!(args as syn::AttributeArgs);
|
||||
let f = syn::parse_macro_input!(item as syn::ItemFn);
|
||||
interrupt::run(args, f).unwrap_or_else(|x| x).into()
|
||||
cortex_m_interrupt::run(args, f)
|
||||
.unwrap_or_else(|x| x)
|
||||
.into()
|
||||
}
|
||||
|
||||
#[proc_macro]
|
||||
pub fn interrupt_declare(item: TokenStream) -> TokenStream {
|
||||
pub fn cortex_m_interrupt_declare(item: TokenStream) -> TokenStream {
|
||||
let name = syn::parse_macro_input!(item as syn::Ident);
|
||||
interrupt_declare::run(name).unwrap_or_else(|x| x).into()
|
||||
cortex_m_interrupt_declare::run(name)
|
||||
.unwrap_or_else(|x| x)
|
||||
.into()
|
||||
}
|
||||
|
||||
/// # interrupt_take procedural macro
|
||||
@ -40,7 +44,9 @@ pub fn interrupt_declare(item: TokenStream) -> TokenStream {
|
||||
/// We are aware that this brings bloat in the form of core::fmt, but the bloat is already included with e.g. array indexing panics.
|
||||
/// To get rid of this bloat, use the compiler flags `-Zbuild-std=core -Zbuild-std-features=panic_immediate_abort`.
|
||||
#[proc_macro]
|
||||
pub fn interrupt_take(item: TokenStream) -> TokenStream {
|
||||
pub fn cortex_m_interrupt_take(item: TokenStream) -> TokenStream {
|
||||
let name = syn::parse_macro_input!(item as syn::Ident);
|
||||
interrupt_take::run(name).unwrap_or_else(|x| x).into()
|
||||
cortex_m_interrupt_take::run(name)
|
||||
.unwrap_or_else(|x| x)
|
||||
.into()
|
||||
}
|
||||
|
Reference in New Issue
Block a user