arch/z80/src/ez80/ez80_spi.c: Fix a poorly constructed loop that would lead to hangs.

This commit is contained in:
Gregory Nutt 2019-06-18 09:28:13 -06:00
parent 4bfa6fe511
commit ad0181a6d4

View File

@ -369,10 +369,8 @@ static int spi_transfer(uint8_t chout, FAR uint8_t *chin)
uint8_t response;
int ret;
/* Send the byte, repeating if some error occurs */
/* Send the byte */
for (; ; )
{
outp(EZ80_SPI_TSR, chout);
/* Wait for the device to be ready to accept another byte */
@ -388,10 +386,10 @@ static int spi_transfer(uint8_t chout, FAR uint8_t *chin)
if (chin != NULL)
{
*chin = response;
}
return OK;
}
}
}
/****************************************************************************
* Name: spi_send