mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 16:23:10 +00:00
Fix more warnings and examples.
This commit is contained in:
parent
3fd9023fce
commit
21e94972dc
@ -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");
|
||||
|
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user