rp: add initial version
This commit is contained in:
@ -125,7 +125,7 @@ pub fn interrupt_declare(item: TokenStream) -> TokenStream {
|
||||
type Priority = crate::interrupt::Priority;
|
||||
fn number(&self) -> u16 {
|
||||
use cortex_m::interrupt::InterruptNumber;
|
||||
let irq = crate::pac::interrupt::#name;
|
||||
let irq = crate::pac::Interrupt::#name;
|
||||
irq.number() as u16
|
||||
}
|
||||
unsafe fn steal() -> Self {
|
||||
@ -199,7 +199,11 @@ mod chip;
|
||||
#[path = "chip/stm32.rs"]
|
||||
mod chip;
|
||||
|
||||
#[cfg(any(feature = "nrf", feature = "stm32"))]
|
||||
#[cfg(feature = "rp")]
|
||||
#[path = "chip/rp.rs"]
|
||||
mod chip;
|
||||
|
||||
#[cfg(any(feature = "nrf", feature = "stm32", feature = "rp"))]
|
||||
#[proc_macro_attribute]
|
||||
pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
|
||||
let macro_args = syn::parse_macro_input!(args as syn::AttributeArgs);
|
||||
@ -267,11 +271,10 @@ pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
|
||||
::core::mem::transmute(t)
|
||||
}
|
||||
|
||||
#chip_setup
|
||||
|
||||
let mut executor = ::embassy::executor::Executor::new();
|
||||
let executor = unsafe { make_static(&mut executor) };
|
||||
executor.set_alarm(alarm);
|
||||
|
||||
#chip_setup
|
||||
|
||||
executor.run(|spawner| {
|
||||
spawner.spawn(__embassy_main(spawner)).unwrap();
|
||||
|
Reference in New Issue
Block a user