mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
mpfs/CoreSPI: Fix bug when waiting for last character to arrive
The logic for rx_fifo_empty is wrong, needs a loop for the retry to work
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
8d646fc49c
commit
fc5e8ff8f8
@@ -781,8 +781,7 @@ static void mpfs_spi_unload_rx_fifo(struct mpfs_spi_priv_s *priv,
|
|||||||
|
|
||||||
for (i = 0; i < nwords; i++)
|
for (i = 0; i < nwords; i++)
|
||||||
{
|
{
|
||||||
rx_fifo_empty = getreg32(MPFS_SPI_STATUS) & MPFS_SPI_RXEMPTY;
|
while ((rx_fifo_empty = getreg32(MPFS_SPI_STATUS) & MPFS_SPI_RXEMPTY))
|
||||||
if (rx_fifo_empty)
|
|
||||||
{
|
{
|
||||||
/* Last RX character not ready yet, try again (once) */
|
/* Last RX character not ready yet, try again (once) */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user