From d26b751edc9aa9d5e5d74da298fcd35ade1d5620 Mon Sep 17 00:00:00 2001 From: chemicstry Date: Thu, 17 Mar 2022 19:41:44 +0200 Subject: [PATCH] Add comments --- embassy-stm32/src/usart/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/embassy-stm32/src/usart/mod.rs b/embassy-stm32/src/usart/mod.rs index 83cdd66b..0466065f 100644 --- a/embassy-stm32/src/usart/mod.rs +++ b/embassy-stm32/src/usart/mod.rs @@ -106,6 +106,8 @@ impl<'d, T: Instance, TxDma> UartTx<'d, T, TxDma> { reg.set_dmat(true); }); } + // If we don't assign future to a variable, the data register pointer + // is held across an await and makes the future non-Send. let transfer = crate::dma::write(ch, request, buffer, tdr(T::regs())); transfer.await; Ok(()) @@ -150,6 +152,8 @@ impl<'d, T: Instance, RxDma> UartRx<'d, T, RxDma> { reg.set_dmar(true); }); } + // If we don't assign future to a variable, the data register pointer + // is held across an await and makes the future non-Send. let transfer = crate::dma::read(ch, request, rdr(T::regs()), buffer); transfer.await; Ok(())