summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/stm32/stm32_spi.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-10-18 21:36:25 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-10-18 21:36:25 +0000
commit523d0fb5427ceccbff2b9a8ef812fff8596ee3dc (patch)
tree0fa86d6fdfbd6f453479d5d1a48cf34fed20d296 /nuttx/arch/arm/src/stm32/stm32_spi.c
parentdbaa783ef42ef49c436a116436a17e7b34553ccb (diff)
downloadpx4-nuttx-523d0fb5427ceccbff2b9a8ef812fff8596ee3dc.tar.gz
px4-nuttx-523d0fb5427ceccbff2b9a8ef812fff8596ee3dc.tar.bz2
px4-nuttx-523d0fb5427ceccbff2b9a8ef812fff8596ee3dc.zip
Wait conditions backward
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2159 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/stm32/stm32_spi.c')
-rwxr-xr-xnuttx/arch/arm/src/stm32/stm32_spi.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_spi.c b/nuttx/arch/arm/src/stm32/stm32_spi.c
index 68f3f729b..ef7c5f307 100755
--- a/nuttx/arch/arm/src/stm32/stm32_spi.c
+++ b/nuttx/arch/arm/src/stm32/stm32_spi.c
@@ -354,7 +354,7 @@ static inline uint16 spi_readword(FAR struct stm32_spidev_s *priv)
{
/* Wait until the receive buffer is not empty */
- while ((spi_getreg(priv, STM32_SPI_SR_OFFSET) & SPI_SR_RXNE) != 0);
+ while ((spi_getreg(priv, STM32_SPI_SR_OFFSET) & SPI_SR_RXNE) == 0);
/* Then return the received byte */
@@ -380,7 +380,7 @@ static inline void spi_writeword(FAR struct stm32_spidev_s *priv, uint16 word)
{
/* Wait until the transmit buffer is empty */
- while ((spi_getreg(priv, STM32_SPI_SR_OFFSET) & SPI_SR_TXE) != 0);
+ while ((spi_getreg(priv, STM32_SPI_SR_OFFSET) & SPI_SR_TXE) == 0);
/* Then send the byte */
@@ -657,11 +657,11 @@ static inline void spi_dmatxstart(FAR struct stm32_spidev_s *priv)
static void spi_modifycr1(FAR struct stm32_spidev_s *priv, uint16 setbits, uint16 clrbits)
{
- uint16 cr1;
- cr1 = spi_getreg(priv, STM32_SPI_CR1_OFFSET);
- cr1 &= ~clrbits;
- cr1 |= setbits;
- spi_putreg(priv, STM32_SPI_CR1_OFFSET, cr1);
+ uint16 cr1;
+ cr1 = spi_getreg(priv, STM32_SPI_CR1_OFFSET);
+ cr1 &= ~clrbits;
+ cr1 |= setbits;
+ spi_putreg(priv, STM32_SPI_CR1_OFFSET, cr1);
}
/************************************************************************************