mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 22:32:29 +00:00
Merge pull request #3516 from embassy-rs/fix-nonlocal
Fix "non-local impl definition" warning from recent nightlies.
This commit is contained in:
commit
dc9fc73704
@ -177,34 +177,43 @@ mod chip;
|
|||||||
// developer note: this macro can't be in `embassy-hal-internal` due to the use of `$crate`.
|
// developer note: this macro can't be in `embassy-hal-internal` due to the use of `$crate`.
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! bind_interrupts {
|
macro_rules! bind_interrupts {
|
||||||
($vis:vis struct $name:ident {
|
($vis:vis struct $name:ident {
|
||||||
$(
|
$(
|
||||||
$(#[cfg($cond_irq:meta)])?
|
$(#[cfg($cond_irq:meta)])?
|
||||||
$irq:ident => $(
|
$irq:ident => $(
|
||||||
$(#[cfg($cond_handler:meta)])?
|
$(#[cfg($cond_handler:meta)])?
|
||||||
$handler:ty
|
$handler:ty
|
||||||
),*;
|
),*;
|
||||||
)*
|
)*
|
||||||
}) => {
|
}) => {
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
$vis struct $name;
|
$vis struct $name;
|
||||||
|
|
||||||
$(
|
$(
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
$(#[cfg($cond_irq)])?
|
$(#[cfg($cond_irq)])?
|
||||||
unsafe extern "C" fn $irq() {
|
unsafe extern "C" fn $irq() {
|
||||||
$(
|
$(
|
||||||
$(#[cfg($cond_handler)])?
|
$(#[cfg($cond_handler)])?
|
||||||
<$handler as $crate::interrupt::typelevel::Handler<$crate::interrupt::typelevel::$irq>>::on_interrupt();
|
<$handler as $crate::interrupt::typelevel::Handler<$crate::interrupt::typelevel::$irq>>::on_interrupt();
|
||||||
|
|
||||||
$(#[cfg($cond_handler)])?
|
)*
|
||||||
unsafe impl $crate::interrupt::typelevel::Binding<$crate::interrupt::typelevel::$irq, $handler> for $name {}
|
}
|
||||||
)*
|
|
||||||
}
|
$(#[cfg($cond_irq)])?
|
||||||
)*
|
$crate::bind_interrupts!(@inner
|
||||||
};
|
$(
|
||||||
|
$(#[cfg($cond_handler)])?
|
||||||
|
unsafe impl $crate::interrupt::typelevel::Binding<$crate::interrupt::typelevel::$irq, $handler> for $name {}
|
||||||
|
)*
|
||||||
|
);
|
||||||
|
)*
|
||||||
|
};
|
||||||
|
(@inner $($t:tt)*) => {
|
||||||
|
$($t)*
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Reexports
|
// Reexports
|
||||||
|
|
||||||
|
@ -175,8 +175,8 @@ macro_rules! bind_interrupts {
|
|||||||
),*;
|
),*;
|
||||||
)*
|
)*
|
||||||
}) => {
|
}) => {
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
$vis struct $name;
|
$vis struct $name;
|
||||||
|
|
||||||
$(
|
$(
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
@ -187,12 +187,21 @@ macro_rules! bind_interrupts {
|
|||||||
$(#[cfg($cond_handler)])?
|
$(#[cfg($cond_handler)])?
|
||||||
<$handler as $crate::interrupt::typelevel::Handler<$crate::interrupt::typelevel::$irq>>::on_interrupt();
|
<$handler as $crate::interrupt::typelevel::Handler<$crate::interrupt::typelevel::$irq>>::on_interrupt();
|
||||||
|
|
||||||
|
)*
|
||||||
|
}
|
||||||
|
|
||||||
|
$(#[cfg($cond_irq)])?
|
||||||
|
$crate::bind_interrupts!(@inner
|
||||||
|
$(
|
||||||
$(#[cfg($cond_handler)])?
|
$(#[cfg($cond_handler)])?
|
||||||
unsafe impl $crate::interrupt::typelevel::Binding<$crate::interrupt::typelevel::$irq, $handler> for $name {}
|
unsafe impl $crate::interrupt::typelevel::Binding<$crate::interrupt::typelevel::$irq, $handler> for $name {}
|
||||||
)*
|
)*
|
||||||
}
|
);
|
||||||
)*
|
)*
|
||||||
};
|
};
|
||||||
|
(@inner $($t:tt)*) => {
|
||||||
|
$($t)*
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rp2040")]
|
#[cfg(feature = "rp2040")]
|
||||||
|
@ -186,12 +186,21 @@ macro_rules! bind_interrupts {
|
|||||||
$(#[cfg($cond_handler)])?
|
$(#[cfg($cond_handler)])?
|
||||||
<$handler as $crate::interrupt::typelevel::Handler<$crate::interrupt::typelevel::$irq>>::on_interrupt();
|
<$handler as $crate::interrupt::typelevel::Handler<$crate::interrupt::typelevel::$irq>>::on_interrupt();
|
||||||
|
|
||||||
|
)*
|
||||||
|
}
|
||||||
|
|
||||||
|
$(#[cfg($cond_irq)])?
|
||||||
|
$crate::bind_interrupts!(@inner
|
||||||
|
$(
|
||||||
$(#[cfg($cond_handler)])?
|
$(#[cfg($cond_handler)])?
|
||||||
unsafe impl $crate::interrupt::typelevel::Binding<$crate::interrupt::typelevel::$irq, $handler> for $name {}
|
unsafe impl $crate::interrupt::typelevel::Binding<$crate::interrupt::typelevel::$irq, $handler> for $name {}
|
||||||
)*
|
)*
|
||||||
}
|
);
|
||||||
)*
|
)*
|
||||||
};
|
};
|
||||||
|
(@inner $($t:tt)*) => {
|
||||||
|
$($t)*
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reexports
|
// Reexports
|
||||||
|
Loading…
Reference in New Issue
Block a user