diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-08 15:28:07 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-08 15:28:07 +0000 |
commit | b6abad5fbf5877bf9c26269bff418726f26e4b9d (patch) | |
tree | 945b66a02dfe50fed4a55a500a96f11d81d7d9e3 /nuttx/arch/arm/src/stm32/stm32_spi.c | |
parent | 1442e62637fa138626671be49b51d5329c6536c3 (diff) | |
download | px4-nuttx-b6abad5fbf5877bf9c26269bff418726f26e4b9d.tar.gz px4-nuttx-b6abad5fbf5877bf9c26269bff418726f26e4b9d.tar.bz2 px4-nuttx-b6abad5fbf5877bf9c26269bff418726f26e4b9d.zip |
Several patches from Petteri Aimonen
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5625 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/stm32/stm32_spi.c')
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_spi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_spi.c b/nuttx/arch/arm/src/stm32/stm32_spi.c index b4a4f36ab..7119247f7 100644 --- a/nuttx/arch/arm/src/stm32/stm32_spi.c +++ b/nuttx/arch/arm/src/stm32/stm32_spi.c @@ -511,7 +511,7 @@ static void spi_dmarxwait(FAR struct stm32_spidev_s *priv) * must not really have completed??? */ - while (sem_wait(&priv->rxsem) != 0 && priv->rxresult == 0) + while (sem_wait(&priv->rxsem) != 0 || priv->rxresult == 0) { /* The only case that an error should occur here is if the wait was awakened * by a signal. @@ -537,7 +537,7 @@ static void spi_dmatxwait(FAR struct stm32_spidev_s *priv) * must not really have completed??? */ - while (sem_wait(&priv->txsem) != 0 && priv->txresult == 0) + while (sem_wait(&priv->txsem) != 0 || priv->txresult == 0) { /* The only case that an error should occur here is if the wait was awakened * by a signal. @@ -731,6 +731,7 @@ static void spi_dmatxsetup(FAR struct stm32_spidev_s *priv, FAR const void *txbu #ifdef CONFIG_STM32_SPI_DMA static inline void spi_dmarxstart(FAR struct stm32_spidev_s *priv) { + priv->rxresult = 0; stm32_dmastart(priv->rxdma, spi_dmarxcallback, priv, false); } #endif @@ -746,6 +747,7 @@ static inline void spi_dmarxstart(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32_SPI_DMA static inline void spi_dmatxstart(FAR struct stm32_spidev_s *priv) { + priv->txresult = 0; stm32_dmastart(priv->txdma, spi_dmatxcallback, priv, false); } #endif |