From c6cf9b801d45f606dc0e900359f975cdc0c2711c Mon Sep 17 00:00:00 2001 From: xoviat Date: Wed, 30 Dec 2020 12:27:47 -0600 Subject: [PATCH] minor rework to get tx working (maybe) --- embassy-stm32f4/src/serial.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/embassy-stm32f4/src/serial.rs b/embassy-stm32f4/src/serial.rs index 59989510..eac11d31 100644 --- a/embassy-stm32f4/src/serial.rs +++ b/embassy-stm32f4/src/serial.rs @@ -207,10 +207,9 @@ where fn poll(self: core::pin::Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()> { let Self { uarte, tx_transfer } = unsafe { self.get_unchecked_mut() }; - - if true { - // tx_transfer.unwrap().is_done() { - let (tx_stream, usart, buf, _) = tx_transfer.take().unwrap().free(); + let mut taken = tx_transfer.take().unwrap(); + if taken.is_done() { + let (tx_stream, usart, buf, _) = taken.free(); uarte.tx_stream.replace(tx_stream); uarte.usart.replace(usart); @@ -218,8 +217,6 @@ where Poll::Ready(()) } else { waker_interrupt!(DMA2_STREAM7, cx.waker().clone()); - // tx_transfer.take().start(|usart| {}); - let mut taken = tx_transfer.take().unwrap(); taken.start(|usart| {}); tx_transfer.replace(taken);