summaryrefslogtreecommitdiffstats
path: root/nuttx/configs/olimex-strp711
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2010-05-04 01:28:47 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2010-05-04 01:28:47 +0000
commit8c8e0bf80089c9b1fd09dedebed1691b1fd97974 (patch)
tree64ef43461291c0afbab24480828c4bf93c5c9886 /nuttx/configs/olimex-strp711
parent6782098546ab83c659ebc3115039002dc8f54462 (diff)
Basic enc29j80 init logic exercised
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@2650 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/configs/olimex-strp711')
-rwxr-xr-xnuttx/configs/olimex-strp711/src/up_enc28j60.c9
-rw-r--r--nuttx/configs/olimex-strp711/src/up_spi.c13
2 files changed, 8 insertions, 14 deletions
diff --git a/nuttx/configs/olimex-strp711/src/up_enc28j60.c b/nuttx/configs/olimex-strp711/src/up_enc28j60.c
index 047d271cf8..63a21067f1 100755
--- a/nuttx/configs/olimex-strp711/src/up_enc28j60.c
+++ b/nuttx/configs/olimex-strp711/src/up_enc28j60.c
@@ -154,8 +154,6 @@ void up_netinitialize(void)
/* Get the SPI port */
- nllvdbg("Initializing SPI port %d\n", ENC28J60_SPI_PORTNO);
-
spi = up_spiinitialize(ENC28J60_SPI_PORTNO);
if (!spi)
{
@@ -172,13 +170,8 @@ void up_netinitialize(void)
return;
}
- nllvdbg("Successfully initialized SPI port %d\n", ENC28J60_SPI_PORTNO);
-
/* Bind the SPI port to the ENC28J60 driver */
- nllvdbg("Binding SPI port %d to ENC28J60 device %d\n",
- ENC28J60_SPI_PORTNO, ENC28J60_DEVNO);
-
ret = enc_initialize(spi, ENC28J60_DEVNO, ENC28J60_IRQ);
if (ret < 0)
{
@@ -187,7 +180,7 @@ void up_netinitialize(void)
return;
}
- nllvdbg("Successfuly bound SPI port %d ENC28J60 device %d\n",
+ nllvdbg("Bound SPI port %d to ENC28J60 device %d\n",
ENC28J60_SPI_PORTNO, ENC28J60_DEVNO);
}
#endif /* CONFIG_NET_ENC28J60 */
diff --git a/nuttx/configs/olimex-strp711/src/up_spi.c b/nuttx/configs/olimex-strp711/src/up_spi.c
index cfddffeeff..3636bc8faf 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);
}
}