minor cleanup to interface

This commit is contained in:
xoviat
2021-01-14 11:42:23 -06:00
parent 24d6b9ed6c
commit 2b15a2674f
2 changed files with 20 additions and 27 deletions

View File

@ -14,6 +14,7 @@ use embassy::uart::Uart;
use embassy::util::Forever;
use embassy_stm32f4::interrupt;
use embassy_stm32f4::serial;
use stm32f4xx_hal::serial::config::Config;
use stm32f4xx_hal::stm32;
use stm32f4xx_hal::{prelude::*, serial::config};
@ -32,15 +33,16 @@ async fn run(dp: stm32::Peripherals, cp: cortex_m::Peripherals) {
let mut serial = unsafe {
serial::Serial::new(
gpioa.pa9.into_alternate_af7(),
gpioa.pa10.into_alternate_af7(),
dp.USART1,
dp.DMA2,
(
gpioa.pa9.into_alternate_af7(),
gpioa.pa10.into_alternate_af7(),
),
interrupt::take!(DMA2_STREAM7),
interrupt::take!(DMA2_STREAM2),
interrupt::take!(USART1),
dp.DMA2,
dp.USART1,
config::Parity::ParityNone,
9600.bps(),
Config::default().baudrate(9600.bps()),
clocks,
)
};