From c949519714268afaf9b26d0ff4a7bc3c207b27d2 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 14 Jan 2022 22:43:40 +0100 Subject: stm32/usart: expose all functionality as inherent methods. --- examples/stm32f4/src/bin/usart.rs | 7 +++---- examples/stm32f4/src/bin/usart_dma.rs | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'examples/stm32f4/src/bin') diff --git a/examples/stm32f4/src/bin/usart.rs b/examples/stm32f4/src/bin/usart.rs index 391a8b9b..b5ea98cc 100644 --- a/examples/stm32f4/src/bin/usart.rs +++ b/examples/stm32f4/src/bin/usart.rs @@ -7,7 +7,6 @@ mod example_common; use cortex_m_rt::entry; use embassy_stm32::dma::NoDma; use embassy_stm32::usart::{Config, Uart}; -use embedded_hal::blocking::serial::Write; use example_common::*; #[entry] @@ -19,12 +18,12 @@ fn main() -> ! { let config = Config::default(); let mut usart = Uart::new(p.USART3, p.PD9, p.PD8, NoDma, NoDma, config); - unwrap!(usart.bwrite_all(b"Hello Embassy World!\r\n")); + unwrap!(usart.blocking_write(b"Hello Embassy World!\r\n")); info!("wrote Hello, starting echo"); let mut buf = [0u8; 1]; loop { - unwrap!(usart.read_blocking(&mut buf)); - unwrap!(usart.bwrite_all(&buf)); + unwrap!(usart.blocking_read(&mut buf)); + unwrap!(usart.blocking_write(&buf)); } } diff --git a/examples/stm32f4/src/bin/usart_dma.rs b/examples/stm32f4/src/bin/usart_dma.rs index 0dbdd7c0..862a91ea 100644 --- a/examples/stm32f4/src/bin/usart_dma.rs +++ b/examples/stm32f4/src/bin/usart_dma.rs @@ -9,7 +9,6 @@ use embassy::executor::Spawner; use embassy_stm32::dma::NoDma; use embassy_stm32::usart::{Config, Uart}; use embassy_stm32::Peripherals; -use embassy_traits::uart::Write as _; use example_common::*; use heapless::String; -- cgit v1.2.3