mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
stm32: change interrupt declarations from macrotables to build.rs.
This commit is contained in:
parent
940412c034
commit
d1a9680422
@ -84,6 +84,23 @@ fn main() {
|
||||
embassy_hal_common::peripherals!(#(#singleton_tokens),*);
|
||||
});
|
||||
|
||||
// ========
|
||||
// Generate interrupt declarations
|
||||
|
||||
let mut irqs = Vec::new();
|
||||
for irq in METADATA.interrupts {
|
||||
irqs.push(format_ident!("{}", irq.name));
|
||||
}
|
||||
|
||||
g.extend(quote! {
|
||||
pub mod interrupt {
|
||||
use crate::pac::Interrupt as InterruptEnum;
|
||||
#(
|
||||
embassy::interrupt::declare!(#irqs);
|
||||
)*
|
||||
}
|
||||
});
|
||||
|
||||
// ========
|
||||
// Generate DMA IRQs.
|
||||
|
||||
|
@ -3,11 +3,4 @@ pub use critical_section::CriticalSection;
|
||||
pub use embassy::interrupt::{take, Interrupt};
|
||||
pub use embassy_hal_common::interrupt::Priority4 as Priority;
|
||||
|
||||
use crate::pac::Interrupt as InterruptEnum;
|
||||
use embassy::interrupt::declare;
|
||||
|
||||
crate::pac::interrupts!(
|
||||
($name:ident) => {
|
||||
declare!($name);
|
||||
};
|
||||
);
|
||||
pub use crate::generated::interrupt::*;
|
||||
|
@ -63,8 +63,6 @@ mod generated {
|
||||
#![allow(unused_imports)]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
use crate::interrupt;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/generated.rs"));
|
||||
}
|
||||
pub use embassy_macros::interrupt;
|
||||
|
Loading…
Reference in New Issue
Block a user