Skip to content

Commit 9ecdbb8

Browse files
lulfhargoniX
authored andcommitted
Require a slice of size 1 for rx_buf
1 parent 2681915 commit 9ecdbb8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nrf-hal-common/src/uarte.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ where
308308
pub fn split(
309309
self,
310310
tx_buf: &'static mut [u8],
311-
rx_buf: &'static mut [u8],
311+
rx_buf: &'static mut [u8; 1],
312312
) -> Result<(UarteTx<T>, UarteRx<T>), Error> {
313313
let tx = UarteTx::new(tx_buf)?;
314314
let rx = UarteRx::new(rx_buf)?;
@@ -711,7 +711,7 @@ where
711711
} else {
712712
// We can only read 1 byte at a time, otherwise ENDTX might not be raised,
713713
// causing the read to stall forever.
714-
start_read(&uarte, &mut self.rx_buf[..1])?;
714+
start_read(&uarte, self.rx_buf)?;
715715
Err(nb::Error::WouldBlock)
716716
}
717717
}

0 commit comments

Comments
 (0)