Interrupt Doc Comments

Support adding doc comments to interrupts
This commit is contained in:
jake-taf 2025-05-14 09:45:20 -04:00 committed by GitHub
parent 870296fcd4
commit be20c708fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -173,8 +173,9 @@ pub use crate::_generated::interrupt;
// 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 { ($(#[$outer:meta])* $vis:vis struct $name:ident {
$( $(
$(#[$inner:meta])*
$(#[cfg($cond_irq:meta)])? $(#[cfg($cond_irq:meta)])?
$irq:ident => $( $irq:ident => $(
$(#[cfg($cond_handler:meta)])? $(#[cfg($cond_handler:meta)])?
@ -183,12 +184,14 @@ macro_rules! bind_interrupts {
)* )*
}) => { }) => {
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
$(#[$outer])*
$vis struct $name; $vis struct $name;
$( $(
#[allow(non_snake_case)] #[allow(non_snake_case)]
#[no_mangle] #[no_mangle]
$(#[cfg($cond_irq)])? $(#[cfg($cond_irq)])?
$(#[$inner])*
unsafe extern "C" fn $irq() { unsafe extern "C" fn $irq() {
$( $(
$(#[cfg($cond_handler)])? $(#[cfg($cond_handler)])?