Stub in the DMA bits that aren't yet there.

This commit is contained in:
Bob McWhirter 2021-06-30 14:58:28 -04:00
parent bf3bc92525
commit 54ada5bae1
4 changed files with 14 additions and 3 deletions

View file

@ -1,9 +1,11 @@
#![macro_use] #![macro_use]
#[cfg(dma)]
#[cfg_attr(dma_v1, path = "v1.rs")] #[cfg_attr(dma_v1, path = "v1.rs")]
#[cfg_attr(dma_v2, path = "v2.rs")] #[cfg_attr(dma_v2, path = "v2.rs")]
mod _version; mod _version;
#[cfg(dma)]
#[allow(unused)] #[allow(unused)]
pub use _version::*; pub use _version::*;

View file

@ -26,7 +26,7 @@ pub mod adc;
pub mod clock; pub mod clock;
#[cfg(dac)] #[cfg(dac)]
pub mod dac; pub mod dac;
#[cfg(dma)] #[cfg(any(dma, dmamux))]
pub mod dma; pub mod dma;
#[cfg(all(eth, feature = "net"))] #[cfg(all(eth, feature = "net"))]
pub mod eth; pub mod eth;

View file

@ -21,7 +21,8 @@ impl<'d, T: Instance> Uart<'d, T> {
) -> Self { ) -> Self {
unborrow!(inner, rx, tx); unborrow!(inner, rx, tx);
T::enable(); // Uncomment once we find all of the H7's UART clocks.
//T::enable();
let pclk_freq = T::frequency(); let pclk_freq = T::frequency();
// TODO: better calculation, including error checking and OVER8 if possible. // TODO: better calculation, including error checking and OVER8 if possible.

View file

@ -58,7 +58,10 @@ fn main() -> ! {
w.dbg_stop().set_bit() w.dbg_stop().set_bit()
}); });
pp.RCC.ahb1enr.modify(|_, w| w.dma1en().set_bit()); pp.RCC.ahb1enr.modify(|_, w| {
w.dma1en().set_bit();
w
});
pp.RCC.ahb2enr.modify(|_, w| { pp.RCC.ahb2enr.modify(|_, w| {
w.gpioaen().set_bit(); w.gpioaen().set_bit();
@ -70,6 +73,11 @@ fn main() -> ! {
w w
}); });
pp.RCC.apb1enr1.modify(|_, w| {
w.uart4en().set_bit();
w
});
pp.RCC.apb2enr.modify(|_, w| { pp.RCC.apb2enr.modify(|_, w| {
w.syscfgen().set_bit(); w.syscfgen().set_bit();
w w