aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32f4-examples/src
diff options
context:
space:
mode:
authorxoviat <[email protected]>2021-01-14 11:42:23 -0600
committerxoviat <[email protected]>2021-01-14 11:42:23 -0600
commit2b15a2674f55d69acd1a4e94ab1cd167ecfa1869 (patch)
tree48ec71b2a18870e52f9fcc7b4a31e1baba78d7bf /embassy-stm32f4-examples/src
parent24d6b9ed6c201f787521d24926551dca2610e3f4 (diff)
minor cleanup to interface
Diffstat (limited to 'embassy-stm32f4-examples/src')
-rw-r--r--embassy-stm32f4-examples/src/bin/serial.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/embassy-stm32f4-examples/src/bin/serial.rs b/embassy-stm32f4-examples/src/bin/serial.rs
index f3e0526c4..c0c71bece 100644
--- a/embassy-stm32f4-examples/src/bin/serial.rs
+++ b/embassy-stm32f4-examples/src/bin/serial.rs
@@ -14,6 +14,7 @@ use embassy::uart::Uart;
14use embassy::util::Forever; 14use embassy::util::Forever;
15use embassy_stm32f4::interrupt; 15use embassy_stm32f4::interrupt;
16use embassy_stm32f4::serial; 16use embassy_stm32f4::serial;
17use stm32f4xx_hal::serial::config::Config;
17use stm32f4xx_hal::stm32; 18use stm32f4xx_hal::stm32;
18use stm32f4xx_hal::{prelude::*, serial::config}; 19use stm32f4xx_hal::{prelude::*, serial::config};
19 20
@@ -32,15 +33,16 @@ async fn run(dp: stm32::Peripherals, cp: cortex_m::Peripherals) {
32 33
33 let mut serial = unsafe { 34 let mut serial = unsafe {
34 serial::Serial::new( 35 serial::Serial::new(
35 gpioa.pa9.into_alternate_af7(), 36 dp.USART1,
36 gpioa.pa10.into_alternate_af7(), 37 dp.DMA2,
38 (
39 gpioa.pa9.into_alternate_af7(),
40 gpioa.pa10.into_alternate_af7(),
41 ),
37 interrupt::take!(DMA2_STREAM7), 42 interrupt::take!(DMA2_STREAM7),
38 interrupt::take!(DMA2_STREAM2), 43 interrupt::take!(DMA2_STREAM2),
39 interrupt::take!(USART1), 44 interrupt::take!(USART1),
40 dp.DMA2, 45 Config::default().baudrate(9600.bps()),
41 dp.USART1,
42 config::Parity::ParityNone,
43 9600.bps(),
44 clocks, 46 clocks,
45 ) 47 )
46 }; 48 };