diff --git a/embassy-cortex-m/src/interrupt.rs b/embassy-cortex-m/src/interrupt.rs index 1df8671b..ead9d52f 100644 --- a/embassy-cortex-m/src/interrupt.rs +++ b/embassy-cortex-m/src/interrupt.rs @@ -15,12 +15,12 @@ pub mod _export { /// Implementation detail, do not use outside embassy crates. #[doc(hidden)] -pub struct Handler { +pub struct DynHandler { pub func: AtomicPtr<()>, pub ctx: AtomicPtr<()>, } -impl Handler { +impl DynHandler { pub const fn new() -> Self { Self { func: AtomicPtr::new(ptr::null_mut()), @@ -51,7 +51,7 @@ pub unsafe trait Interrupt: Peripheral

{ /// Implementation detail, do not use outside embassy crates. #[doc(hidden)] - unsafe fn __handler(&self) -> &'static Handler; + unsafe fn __handler(&self) -> &'static DynHandler; } /// Represents additional behavior for all interrupts. diff --git a/embassy-macros/src/macros/cortex_m_interrupt_declare.rs b/embassy-macros/src/macros/cortex_m_interrupt_declare.rs index ebbb47cd..699883ef 100644 --- a/embassy-macros/src/macros/cortex_m_interrupt_declare.rs +++ b/embassy-macros/src/macros/cortex_m_interrupt_declare.rs @@ -21,9 +21,9 @@ pub fn run(name: syn::Ident) -> Result { unsafe fn steal() -> Self { Self(()) } - unsafe fn __handler(&self) -> &'static ::embassy_cortex_m::interrupt::Handler { + unsafe fn __handler(&self) -> &'static ::embassy_cortex_m::interrupt::DynHandler { #[export_name = #name_handler] - static HANDLER: ::embassy_cortex_m::interrupt::Handler = ::embassy_cortex_m::interrupt::Handler::new(); + static HANDLER: ::embassy_cortex_m::interrupt::DynHandler = ::embassy_cortex_m::interrupt::DynHandler::new(); &HANDLER } } diff --git a/embassy-macros/src/macros/cortex_m_interrupt_take.rs b/embassy-macros/src/macros/cortex_m_interrupt_take.rs index d30189ce..e2ebf98c 100644 --- a/embassy-macros/src/macros/cortex_m_interrupt_take.rs +++ b/embassy-macros/src/macros/cortex_m_interrupt_take.rs @@ -30,7 +30,7 @@ pub fn run(name: syn::Ident) -> Result { pub unsafe extern "C" fn trampoline() { extern "C" { #[link_name = #name_handler] - static HANDLER: interrupt::Handler; + static HANDLER: interrupt::DynHandler; } let func = HANDLER.func.load(interrupt::_export::atomic::Ordering::Relaxed);