arch/z80/src/ez80/ez80_spi.c: Fix a poorly constructed loop that would lead to hangs.
This commit is contained in:
parent
4bfa6fe511
commit
ad0181a6d4
@ -369,10 +369,8 @@ static int spi_transfer(uint8_t chout, FAR uint8_t *chin)
|
|||||||
uint8_t response;
|
uint8_t response;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Send the byte, repeating if some error occurs */
|
/* Send the byte */
|
||||||
|
|
||||||
for (; ; )
|
|
||||||
{
|
|
||||||
outp(EZ80_SPI_TSR, chout);
|
outp(EZ80_SPI_TSR, chout);
|
||||||
|
|
||||||
/* Wait for the device to be ready to accept another byte */
|
/* 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)
|
if (chin != NULL)
|
||||||
{
|
{
|
||||||
*chin = response;
|
*chin = response;
|
||||||
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: spi_send
|
* Name: spi_send
|
||||||
|
Loading…
Reference in New Issue
Block a user