From 83f63890e59715596093c907c50998d2f1033adb Mon Sep 17 00:00:00 2001 From: Bob McWhirter Date: Thu, 22 Jul 2021 09:50:34 -0400 Subject: [PATCH] Actually take a &mut of that read slice. --- embassy-stm32/src/spi/v1.rs | 4 +++- embassy-stm32/src/spi/v2.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/embassy-stm32/src/spi/v1.rs b/embassy-stm32/src/spi/v1.rs index b4ebe5a6..43489bb6 100644 --- a/embassy-stm32/src/spi/v1.rs +++ b/embassy-stm32/src/spi/v1.rs @@ -244,7 +244,9 @@ impl<'d, T: Instance, Tx, Rx> Spi<'d, T, Tx, Rx> { let rx_request = self.rxdma.request(); let rx_src = T::regs().dr().ptr() as *mut u8; - let rx_f = self.rxdma.read(rx_request, rx_src, read[0..write.len()]); + let rx_f = self + .rxdma + .read(rx_request, rx_src, &mut read[0..write.len()]); let tx_request = self.txdma.request(); let tx_dst = T::regs().dr().ptr() as *mut u8; diff --git a/embassy-stm32/src/spi/v2.rs b/embassy-stm32/src/spi/v2.rs index 9ca3e3c1..2144dfcc 100644 --- a/embassy-stm32/src/spi/v2.rs +++ b/embassy-stm32/src/spi/v2.rs @@ -256,7 +256,9 @@ impl<'d, T: Instance, Tx, Rx> Spi<'d, T, Tx, Rx> { let rx_request = self.rxdma.request(); let rx_src = T::regs().dr().ptr() as *mut u8; - let rx_f = self.rxdma.read(rx_request, rx_src, read[0..write.len()]); + let rx_f = self + .rxdma + .read(rx_request, rx_src, &mut read[0..write.len()]); let tx_request = self.txdma.request(); let tx_dst = T::regs().dr().ptr() as *mut u8;