summaryrefslogtreecommitdiff
path: root/nuttx/configs/olimex-strp711/src/up_spi.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-05-04 01:28:47 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-05-04 01:28:47 +0000
commitb3e9a45e0f48658818b7bf8ef6f23e60be2f9e37 (patch)
tree64ef43461291c0afbab24480828c4bf93c5c9886 /nuttx/configs/olimex-strp711/src/up_spi.c
parenteccc4cf309273c74ea4a51c57efcaf29572175c0 (diff)
downloadpx4-nuttx-b3e9a45e0f48658818b7bf8ef6f23e60be2f9e37.tar.gz
px4-nuttx-b3e9a45e0f48658818b7bf8ef6f23e60be2f9e37.tar.bz2
px4-nuttx-b3e9a45e0f48658818b7bf8ef6f23e60be2f9e37.zip
Basic enc29j80 init logic exercised
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2650 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/olimex-strp711/src/up_spi.c')
-rw-r--r--nuttx/configs/olimex-strp711/src/up_spi.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/nuttx/configs/olimex-strp711/src/up_spi.c b/nuttx/configs/olimex-strp711/src/up_spi.c
index cfddffeef..3636bc8fa 100644
--- a/nuttx/configs/olimex-strp711/src/up_spi.c
+++ b/nuttx/configs/olimex-strp711/src/up_spi.c
@@ -42,6 +42,7 @@
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
+#include <debug.h>
#include <nuttx/spi.h>
@@ -525,7 +526,7 @@ static inline void spi_drain(FAR struct str71x_spidev_s *priv)
{
(void)spi_getreg(priv, STR71X_BSPI_RXR_OFFSET);
}
- while (spi_getreg(priv, STR71X_BSPI_CSR2_OFFSET & STR71X_BSPICSR2_RFNE) != 0);
+ while ((spi_getreg(priv, STR71X_BSPI_CSR2_OFFSET) & STR71X_BSPICSR2_RFNE) != 0);
}
/****************************************************************************
@@ -556,7 +557,7 @@ static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel
reg16 = spi_getreg(priv, STR71X_GPIO_PD_OFFSET);
if (selected)
{
- /* Enable slave select (low enables) */
+ /* Enable slave select (low enables) */
reg16 &= ~priv->csbit;
spi_putreg(priv, STR71X_GPIO_PD_OFFSET, reg16);
@@ -565,12 +566,12 @@ static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel
{
/* Disable slave select (low enables) */
- reg16 |= priv->csbit;
- spi_putreg(priv, STR71X_GPIO_PD_OFFSET, reg16);
+ reg16 |= priv->csbit;
+ spi_putreg(priv, STR71X_GPIO_PD_OFFSET, reg16);
- /* And drain the FIFOs */
+ /* And drain the FIFOs */
- spi_drain(priv);
+ spi_drain(priv);
}
}