From 3f74c557edf3880d0cb7b4b4c2168a05ff8129f2 Mon Sep 17 00:00:00 2001 From: Folkert Date: Sat, 5 Jun 2021 11:34:50 +0200 Subject: [PATCH] skip 'in ram' check for mutable slice in fullduplex --- embassy-nrf/src/spim.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/embassy-nrf/src/spim.rs b/embassy-nrf/src/spim.rs index 0ca18d88c..b5e9afbc1 100644 --- a/embassy-nrf/src/spim.rs +++ b/embassy-nrf/src/spim.rs @@ -196,8 +196,9 @@ impl<'d, T: Instance> FullDuplex for Spim<'d, T> { fn read_write<'a>(&'a mut self, rx: &'a mut [u8], tx: &'a [u8]) -> Self::WriteReadFuture<'a> { async move { - slice_in_ram_or(rx, Error::DMABufferNotInDataMemory)?; slice_in_ram_or(tx, Error::DMABufferNotInDataMemory)?; + // NOTE: RAM slice check for rx is not necessary, as a mutable + // slice can only be built from data located in RAM. // Conservative compiler fence to prevent optimizations that do not // take in to account actions by DMA. The fence has been placed here,