Fix more warnings and examples.

This commit is contained in:
Bob McWhirter 2021-07-14 14:55:20 -04:00
parent 3fd9023fce
commit 21e94972dc
2 changed files with 4 additions and 4 deletions

View File

@ -18,13 +18,14 @@ use example_common::*;
use cortex_m_rt::entry;
use stm32l4::stm32l4x5 as pac;
use embassy_stm32::dma_traits::NoDma;
#[embassy::task]
async fn main_task() {
let p = embassy_stm32::init(Default::default());
let config = Config::default();
let mut usart = Uart::new(p.UART4, p.PA1, p.PA0, config);
let mut usart = Uart::new(p.UART4, p.PA1, p.PA0, NoDma, NoDma, config);
usart.bwrite_all(b"Hello Embassy World!\r\n").unwrap();
info!("wrote Hello, starting echo");

View File

@ -19,11 +19,10 @@ use heapless::String;
use stm32l4::stm32l4x5 as pac;
use embassy_stm32::dma_traits::NoDma;
use embassy_traits::uart::Write as AsyncWrite;
use embassy::io::AsyncWriteExt;
#[embassy::task]
async fn main_task() {
let mut p = embassy_stm32::init(Default::default());
let p = embassy_stm32::init(Default::default());
let config = Config::default();
let mut usart = Uart::new(p.UART4, p.PA1, p.PA0, p.DMA1_3, NoDma, config);
@ -32,7 +31,7 @@ async fn main_task() {
let mut s: String<128> = String::new();
core::write!(&mut s, "Hello DMA World {}!\r\n", n).unwrap();
usart.write( s.as_bytes() ).await;
usart.write( s.as_bytes() ).await.ok();
info!("wrote DMA");
}