Only use cortex-m when target is cortex-m. Fixes
@@ -173,12 +173,17 @@ pub fn render(
root.extend(interrupt_enum);
} else {
let interrupt_enum = quote! {
- ///Enumeration of all the interrupts
+ ///Enumeration of all the interrupts.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#enum_repr
pub enum Interrupt {
#variants
}
+ };
+
+ if target == Target::CortexM {
+ root.extend(quote! {
+ #interrupt_enum
unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
#[inline(always)]
@@ -186,10 +191,7 @@ pub fn render(
#nr_expr
}
}
- };
-
- if target == Target::CortexM {
- root.extend(interrupt_enum);
+ });
} else {
mod_items.extend(quote! {
#interrupt_enum
