Skip to content

Commit e9d7a38

Browse files
committed
Rename serial read_all to read_exact
This better reflects what that function is doing, namely reading as many bytes as there is space in the given buffer.
1 parent ffb4eff commit e9d7a38

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/serial_dma.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn main() -> ! {
4444

4545
// start separate DMAs for sending and receiving the data
4646
let sending = tx.write_all(Pin::new(tx_buf), tx_channel);
47-
let receiving = rx.read_all(Pin::new(rx_buf), rx_channel);
47+
let receiving = rx.read_exact(Pin::new(rx_buf), rx_channel);
4848

4949
// block until all data was transmitted and received
5050
let (mut tx_buf, tx_channel, tx) = sending.wait();
@@ -56,7 +56,7 @@ fn main() -> ! {
5656
tx_buf.copy_from_slice(b"hi again!");
5757

5858
let sending = tx.write_all(tx_buf, tx_channel);
59-
let receiving = rx.read_all(rx_buf, rx_channel);
59+
let receiving = rx.read_exact(rx_buf, rx_channel);
6060

6161
let (tx_buf, ..) = sending.wait();
6262
let (rx_buf, ..) = receiving.wait();

src/serial.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ macro_rules! hal {
381381
#[cfg(feature = "stm32f303")]
382382
impl Rx<$USARTX> {
383383
/// Fill the buffer with received data using DMA.
384-
pub fn read_all<B, C>(
384+
pub fn read_exact<B, C>(
385385
self,
386386
mut buffer: Pin<B>,
387387
mut channel: C

0 commit comments

Comments
 (0)