Standardize module structure, fix some build failures
This commit is contained in:
@ -17,24 +17,19 @@ pub mod exti;
|
||||
pub mod gpio;
|
||||
#[cfg(feature = "_rng")]
|
||||
pub mod rng;
|
||||
#[cfg(feature = "_sdmmc")]
|
||||
pub mod sdmmc;
|
||||
#[cfg(feature = "_spi")]
|
||||
pub mod spi;
|
||||
#[cfg(feature = "_usart")]
|
||||
pub mod usart;
|
||||
|
||||
#[macro_use]
|
||||
pub mod sdmmc_v2;
|
||||
|
||||
#[cfg(feature = "_sdmmc_v2")]
|
||||
pub use sdmmc_v2 as sdmmc;
|
||||
|
||||
// This must go LAST so that it sees the `impl_foo!` macros
|
||||
mod pac;
|
||||
|
||||
pub mod time;
|
||||
|
||||
pub use embassy_macros;
|
||||
pub use embassy_macros::interrupt;
|
||||
pub use embassy_macros::interrupt as irq;
|
||||
pub use pac::{interrupt, peripherals, Peripherals};
|
||||
|
||||
// workaround for svd2rust-generated code using `use crate::generic::*;`
|
||||
@ -56,31 +51,8 @@ pub fn init(_config: Config) -> Peripherals {
|
||||
let p = Peripherals::take();
|
||||
|
||||
unsafe {
|
||||
interrupt::EXTI0::steal().enable();
|
||||
interrupt::EXTI1::steal().enable();
|
||||
interrupt::EXTI2::steal().enable();
|
||||
interrupt::EXTI3::steal().enable();
|
||||
interrupt::EXTI4::steal().enable();
|
||||
interrupt::EXTI9_5::steal().enable();
|
||||
interrupt::EXTI15_10::steal().enable();
|
||||
interrupt::EXTI15_10::steal().enable();
|
||||
|
||||
interrupt::DMA1_Stream0::steal().enable();
|
||||
interrupt::DMA1_Stream1::steal().enable();
|
||||
interrupt::DMA1_Stream2::steal().enable();
|
||||
interrupt::DMA1_Stream3::steal().enable();
|
||||
interrupt::DMA1_Stream4::steal().enable();
|
||||
interrupt::DMA1_Stream5::steal().enable();
|
||||
interrupt::DMA1_Stream6::steal().enable();
|
||||
interrupt::DMA1_Stream7::steal().enable();
|
||||
interrupt::DMA2_Stream0::steal().enable();
|
||||
interrupt::DMA2_Stream1::steal().enable();
|
||||
interrupt::DMA2_Stream2::steal().enable();
|
||||
interrupt::DMA2_Stream3::steal().enable();
|
||||
interrupt::DMA2_Stream4::steal().enable();
|
||||
interrupt::DMA2_Stream5::steal().enable();
|
||||
interrupt::DMA2_Stream6::steal().enable();
|
||||
interrupt::DMA2_Stream7::steal().enable();
|
||||
exti::init();
|
||||
dma::init();
|
||||
}
|
||||
|
||||
p
|
||||
|
Reference in New Issue
Block a user