aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-stm32/src/dma/mod.rs2
-rw-r--r--embassy-stm32/src/lib.rs2
-rw-r--r--embassy-stm32/src/usart/v3.rs3
-rw-r--r--examples/stm32l4/src/bin/usart.rs10
4 files changed, 14 insertions, 3 deletions
diff --git a/embassy-stm32/src/dma/mod.rs b/embassy-stm32/src/dma/mod.rs
index 371741ffd..466cfa033 100644
--- a/embassy-stm32/src/dma/mod.rs
+++ b/embassy-stm32/src/dma/mod.rs
@@ -1,9 +1,11 @@
1#![macro_use] 1#![macro_use]
2 2
3#[cfg(dma)]
3#[cfg_attr(dma_v1, path = "v1.rs")] 4#[cfg_attr(dma_v1, path = "v1.rs")]
4#[cfg_attr(dma_v2, path = "v2.rs")] 5#[cfg_attr(dma_v2, path = "v2.rs")]
5mod _version; 6mod _version;
6 7
8#[cfg(dma)]
7#[allow(unused)] 9#[allow(unused)]
8pub use _version::*; 10pub use _version::*;
9 11
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs
index 9ba7bbe4c..76a6ecd88 100644
--- a/embassy-stm32/src/lib.rs
+++ b/embassy-stm32/src/lib.rs
@@ -26,7 +26,7 @@ pub mod adc;
26pub mod clock; 26pub mod clock;
27#[cfg(dac)] 27#[cfg(dac)]
28pub mod dac; 28pub mod dac;
29#[cfg(dma)] 29#[cfg(any(dma, dmamux))]
30pub mod dma; 30pub mod dma;
31#[cfg(all(eth, feature = "net"))] 31#[cfg(all(eth, feature = "net"))]
32pub mod eth; 32pub mod eth;
diff --git a/embassy-stm32/src/usart/v3.rs b/embassy-stm32/src/usart/v3.rs
index 32850c9c4..c45af0043 100644
--- a/embassy-stm32/src/usart/v3.rs
+++ b/embassy-stm32/src/usart/v3.rs
@@ -21,7 +21,8 @@ impl<'d, T: Instance> Uart<'d, T> {
21 ) -> Self { 21 ) -> Self {
22 unborrow!(inner, rx, tx); 22 unborrow!(inner, rx, tx);
23 23
24 T::enable(); 24 // Uncomment once we find all of the H7's UART clocks.
25 //T::enable();
25 let pclk_freq = T::frequency(); 26 let pclk_freq = T::frequency();
26 27
27 // TODO: better calculation, including error checking and OVER8 if possible. 28 // TODO: better calculation, including error checking and OVER8 if possible.
diff --git a/examples/stm32l4/src/bin/usart.rs b/examples/stm32l4/src/bin/usart.rs
index 6b2b13810..5b6d9eaa1 100644
--- a/examples/stm32l4/src/bin/usart.rs
+++ b/examples/stm32l4/src/bin/usart.rs
@@ -58,7 +58,10 @@ fn main() -> ! {
58 w.dbg_stop().set_bit() 58 w.dbg_stop().set_bit()
59 }); 59 });
60 60
61 pp.RCC.ahb1enr.modify(|_, w| w.dma1en().set_bit()); 61 pp.RCC.ahb1enr.modify(|_, w| {
62 w.dma1en().set_bit();
63 w
64 });
62 65
63 pp.RCC.ahb2enr.modify(|_, w| { 66 pp.RCC.ahb2enr.modify(|_, w| {
64 w.gpioaen().set_bit(); 67 w.gpioaen().set_bit();
@@ -70,6 +73,11 @@ fn main() -> ! {
70 w 73 w
71 }); 74 });
72 75
76 pp.RCC.apb1enr1.modify(|_, w| {
77 w.uart4en().set_bit();
78 w
79 });
80
73 pp.RCC.apb2enr.modify(|_, w| { 81 pp.RCC.apb2enr.modify(|_, w| {
74 w.syscfgen().set_bit(); 82 w.syscfgen().set_bit();
75 w 83 w