diff --git a/examples/serial_dma.rs b/examples/serial_dma.rs index fdfb7117d..4b7d0e8d9 100644 --- a/examples/serial_dma.rs +++ b/examples/serial_dma.rs @@ -44,7 +44,7 @@ fn main() -> ! { // start separate DMAs for sending and receiving the data let sending = tx.write_all(Pin::new(tx_buf), tx_channel); - let receiving = rx.read_all(Pin::new(rx_buf), rx_channel); + let receiving = rx.read_exact(Pin::new(rx_buf), rx_channel); // block until all data was transmitted and received let (mut tx_buf, tx_channel, tx) = sending.wait(); @@ -56,7 +56,7 @@ fn main() -> ! { tx_buf.copy_from_slice(b"hi again!"); let sending = tx.write_all(tx_buf, tx_channel); - let receiving = rx.read_all(rx_buf, rx_channel); + let receiving = rx.read_exact(rx_buf, rx_channel); let (tx_buf, ..) = sending.wait(); let (rx_buf, ..) = receiving.wait(); diff --git a/src/serial.rs b/src/serial.rs index 972a40b1c..8dccfe4fb 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -374,7 +374,7 @@ macro_rules! hal { #[cfg(feature = "stm32f303")] impl Rx<$USARTX> { /// Fill the buffer with received data using DMA. - pub fn read_all( + pub fn read_exact( self, mut buffer: Pin, mut channel: C