Fix more warnings and examples.
This commit is contained in:
parent
3fd9023fce
commit
21e94972dc
2 changed files with 4 additions and 4 deletions
|
@ -18,13 +18,14 @@ use example_common::*;
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use stm32l4::stm32l4x5 as pac;
|
use stm32l4::stm32l4x5 as pac;
|
||||||
|
use embassy_stm32::dma_traits::NoDma;
|
||||||
|
|
||||||
#[embassy::task]
|
#[embassy::task]
|
||||||
async fn main_task() {
|
async fn main_task() {
|
||||||
let p = embassy_stm32::init(Default::default());
|
let p = embassy_stm32::init(Default::default());
|
||||||
|
|
||||||
let config = Config::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();
|
usart.bwrite_all(b"Hello Embassy World!\r\n").unwrap();
|
||||||
info!("wrote Hello, starting echo");
|
info!("wrote Hello, starting echo");
|
||||||
|
|
|
@ -19,11 +19,10 @@ use heapless::String;
|
||||||
use stm32l4::stm32l4x5 as pac;
|
use stm32l4::stm32l4x5 as pac;
|
||||||
use embassy_stm32::dma_traits::NoDma;
|
use embassy_stm32::dma_traits::NoDma;
|
||||||
use embassy_traits::uart::Write as AsyncWrite;
|
use embassy_traits::uart::Write as AsyncWrite;
|
||||||
use embassy::io::AsyncWriteExt;
|
|
||||||
|
|
||||||
#[embassy::task]
|
#[embassy::task]
|
||||||
async fn main_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 config = Config::default();
|
||||||
let mut usart = Uart::new(p.UART4, p.PA1, p.PA0, p.DMA1_3, NoDma, config);
|
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();
|
let mut s: String<128> = String::new();
|
||||||
core::write!(&mut s, "Hello DMA World {}!\r\n", n).unwrap();
|
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");
|
info!("wrote DMA");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue