Skip to content

Commit 6d1c244

Browse files
committed
Introduce Hack to fix stm32f302xd build
1 parent a7c10ef commit 6d1c244

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/spi.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,19 @@ mod interrupts {
434434
}
435435
}
436436

437-
#[cfg(feature = "gpio-f303e")]
438-
pub(crate) const SPI4: Interrupt = Interrupt::SPI4;
437+
438+
cfg_if::cfg_if! {
439+
if #[cfg(any(feature = "gpio-f303e", feature = "svd-f302"))] {
440+
// XXX This is a hack.
441+
// SPI4 should have a corresponding nvic interrupt number. But the svd does not
442+
// generated an enum-number for that. The RM0365 does also not list it as an interrupt.
443+
// Strangly though, the Stm32CubeMx program let's us choose to enable the NVIC
444+
// interrupt. This is probably a documentation bug.
445+
pub(crate) const SPI4: Interrupt = Interrupt::SPI3;
446+
} else if #[cfg(feature = "gpio-f303e")] {
447+
pub(crate) const SPI4: Interrupt = Interrupt::SPI4;
448+
}
449+
}
439450
}
440451

441452
#[cfg(any(

0 commit comments

Comments
 (0)