Revert "serial: stm32: Give H/W a chance to set the TXE bit on transfer"
Don't busy-wait in uart_stm32_fifo_fill(), this routine is supposed
to be called on IRQ, and the waiting loop was shown to interfere
with interrupt-driven UART handling.
The original problem mentioned in the patch being reverted ("it is
possible to evaluate the TXE bit *before* H/W has had the
opportunity to detect that data is being processed") may still
exist and may require handling in a different way. The most obvious
way is to replace "while" loop with "if", because STM32 doesn't
have multi-level FIFO anyway. But I was dissuaded to include such a
change as part of this patch, so it's left for future analysis.
This reverts commit 49c2858d94
.
Change-Id: Ib27b53ba3a29b84c1a2dccff6d33f4118680cc19
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
parent
c759ed1f94
commit
abf284e9fd
1 changed files with 0 additions and 7 deletions
|
@ -95,13 +95,6 @@ static int uart_stm32_fifo_fill(struct device *dev, const u8_t *tx_data,
|
||||||
#else
|
#else
|
||||||
LL_USART_TransmitData8(UartHandle->Instance, tx_data[num_tx++]);
|
LL_USART_TransmitData8(UartHandle->Instance, tx_data[num_tx++]);
|
||||||
#endif
|
#endif
|
||||||
/*
|
|
||||||
* Wait for H/W to set TXE flag, or else it will be evaluated
|
|
||||||
* again at the top of this loop *before* H/W has chance to
|
|
||||||
* initially detect that data is being processed.
|
|
||||||
*/
|
|
||||||
while (!__HAL_UART_GET_FLAG(UartHandle, UART_FLAG_TXE))
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return num_tx;
|
return num_tx;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue