mirror of
https://github.com/apache/nuttx.git
synced 2026-08-14 17:03:29 +00:00
Fix backward wait condition in KL24Z SPI driver
This commit is contained in:
parent
2e40a98c74
commit
d088cbec5b
2 changed files with 6 additions and 6 deletions
|
|
@ -488,7 +488,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd)
|
|||
|
||||
/* Make sure that the transmit buffer is empty */
|
||||
|
||||
while ((spi_getreg(priv, KL_SPI_S_OFFSET) & SPI_S_SPTEF) != 0);
|
||||
while ((spi_getreg(priv, KL_SPI_S_OFFSET) & SPI_S_SPTEF) == 0);
|
||||
|
||||
/* Write the data to transmitted to the SPI Data Register */
|
||||
|
||||
|
|
@ -555,7 +555,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer,
|
|||
* to the serializer.
|
||||
*/
|
||||
|
||||
while ((spi_getreg(priv, KL_SPI_S_OFFSET) & SPI_S_SPTEF) != 0);
|
||||
while ((spi_getreg(priv, KL_SPI_S_OFFSET) & SPI_S_SPTEF) == 0);
|
||||
|
||||
/* Write the data to transmitted to the Transmit Data Register (TDR) */
|
||||
|
||||
|
|
@ -675,7 +675,7 @@ FAR struct spi_dev_s *up_spiinitialize(int port)
|
|||
|
||||
/* Enable clocking */
|
||||
|
||||
regval = getreg32(KL_SIM_SCGC4);
|
||||
regval = getreg32(KL_SIM_SCGC4);
|
||||
regval |= SIM_SCGC4_SPI0;
|
||||
putreg32(regval, KL_SIM_SCGC4);
|
||||
}
|
||||
|
|
@ -694,7 +694,7 @@ FAR struct spi_dev_s *up_spiinitialize(int port)
|
|||
|
||||
/* Enable clocking */
|
||||
|
||||
regval = getreg32(KL_SIM_SCGC4);
|
||||
regval = getreg32(KL_SIM_SCGC4);
|
||||
regval |= SIM_SCGC4_SPI1;
|
||||
putreg32(regval, KL_SIM_SCGC4);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ extern "C" {
|
|||
* Public Function Prototypes
|
||||
************************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: up_spiinitialize
|
||||
*
|
||||
* Description:
|
||||
|
|
@ -78,7 +78,7 @@ extern "C" {
|
|||
* Returned Value:
|
||||
* Valid SPI device structure reference on succcess; a NULL on failure
|
||||
*
|
||||
****************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
struct spi_dev_s;
|
||||
FAR struct spi_dev_s *up_spiinitialize(int port);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue