Skip to content

Commit a45bd6f

Browse files
committed
Check that buffers are in RAM
1 parent 4ed85a5 commit a45bd6f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

nrf-hal-common/src/uarte.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ where
463463
T: Instance,
464464
{
465465
fn new(tx_buf: &'a mut [u8]) -> Result<UarteTx<'a, T>, Error> {
466+
slice_in_ram_or(tx_buf, Error::BufferNotInRAM)?;
466467
if tx_buf.len() > 0 {
467468
Ok(UarteTx {
468469
_marker: core::marker::PhantomData,
@@ -479,6 +480,7 @@ where
479480
T: Instance,
480481
{
481482
fn new(rx_buf: &'a mut [u8]) -> Result<UarteRx<'a, T>, Error> {
483+
slice_in_ram_or(rx_buf, Error::BufferNotInRAM)?;
482484
if rx_buf.len() > 0 {
483485
Ok(UarteRx {
484486
_marker: core::marker::PhantomData,

0 commit comments

Comments
 (0)