More debug fixes

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2649 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2010-05-03 03:46:21 +00:00
parent 74ef4fdabd
commit d8a9c604d5
2 changed files with 13 additions and 15 deletions

View File

@ -200,7 +200,7 @@ int str71x_xticonfig(int irq, bool rising)
/* Configure one of the 16 lines as an interrupt source */ /* Configure one of the 16 lines as an interrupt source */
if (irq > STR71X_IRQ_FIRSTXTI && irq <= NR_IRQS) if (irq >= STR71X_IRQ_FIRSTXTI && irq <= NR_IRQS)
{ {
/* Make sure that the interrupt is disabled */ /* Make sure that the interrupt is disabled */
@ -254,7 +254,7 @@ void str71x_enable_xtiirq(int irq)
/* Enable the external interrupt */ /* Enable the external interrupt */
if (irq > STR71X_IRQ_FIRSTXTI && irq <= NR_IRQS) if (irq >= STR71X_IRQ_FIRSTXTI && irq <= NR_IRQS)
{ {
/* Decide if we use the lower or upper regiser */ /* Decide if we use the lower or upper regiser */
@ -294,7 +294,7 @@ void str71x_disable_xtiirq(int irq)
/* Disable the external interrupt */ /* Disable the external interrupt */
if (irq > STR71X_IRQ_FIRSTXTI && irq <= NR_IRQS) if (irq >= STR71X_IRQ_FIRSTXTI && irq <= NR_IRQS)
{ {
/* Decide if we use the lower or upper regiser */ /* Decide if we use the lower or upper regiser */

View File

@ -125,7 +125,7 @@
/* SPI Assumptions **********************************************************/ /* SPI Assumptions **********************************************************/
#define ENC28J60_SPI_PORTNO 1 /* On SPI1 */ #define ENC28J60_SPI_PORTNO 0 /* On SPI0 */
#define ENC28J60_DEVNO 0 /* Only one ENC28J60 */ #define ENC28J60_DEVNO 0 /* Only one ENC28J60 */
#define ENC28J60_IRQ STR71X_IRQ_FIRSTXTI /* NEEDED!!!!!!!!!!!!!!!! */ #define ENC28J60_IRQ STR71X_IRQ_FIRSTXTI /* NEEDED!!!!!!!!!!!!!!!! */
@ -154,13 +154,12 @@ void up_netinitialize(void)
/* Get the SPI port */ /* Get the SPI port */
nvdbg("Initializing SPI port %d\n", ENC28J60_SPI_PORTNO); nllvdbg("Initializing SPI port %d\n", ENC28J60_SPI_PORTNO);
spi = up_spiinitialize(ENC28J60_SPI_PORTNO); spi = up_spiinitialize(ENC28J60_SPI_PORTNO);
if (!spi) if (!spi)
{ {
ndbg("Failed to initialize SPI port %d\n", nlldbg("Failed to initialize SPI port %d\n", ENC28J60_SPI_PORTNO);
ENC28J60_SPI_PORTNO);
return; return;
} }
@ -169,27 +168,26 @@ void up_netinitialize(void)
ret = str71x_xticonfig(ENC28J60_IRQ, false); ret = str71x_xticonfig(ENC28J60_IRQ, false);
if (ret < 0) if (ret < 0)
{ {
ndbg("Failed configure interrupt for IRQ %d: %d\n", ENC28J60_IRQ, ret); nlldbg("Failed configure interrupt for IRQ %d: %d\n", ENC28J60_IRQ, ret);
return; return;
} }
nvdbg("Successfully initialized SPI port %d\n", nllvdbg("Successfully initialized SPI port %d\n", ENC28J60_SPI_PORTNO);
ENC28J60_SPI_PORTNO);
/* Bind the SPI port to the ENC28J60 driver */ /* Bind the SPI port to the ENC28J60 driver */
nvdbg("Binding SPI port %d to ENC28J60 device %d\n", nllvdbg("Binding SPI port %d to ENC28J60 device %d\n",
ENC28J60_SPI_PORTNO, ENC28J60_DEVNO); ENC28J60_SPI_PORTNO, ENC28J60_DEVNO);
ret = enc_initialize(spi, ENC28J60_DEVNO, ENC28J60_IRQ); ret = enc_initialize(spi, ENC28J60_DEVNO, ENC28J60_IRQ);
if (ret < 0) if (ret < 0)
{ {
ndbg("Failed to bind SPI port %d ENC28J60 device %d: %d\n", nlldbg("Failed to bind SPI port %d ENC28J60 device %d: %d\n",
ENC28J60_SPI_PORTNO, ENC28J60_DEVNO, ret); ENC28J60_SPI_PORTNO, ENC28J60_DEVNO, ret);
return; return;
} }
nvdbg("Successfuly bound SPI port %d ENC28J60 device %d\n", nllvdbg("Successfuly bound SPI port %d ENC28J60 device %d\n",
ENC28J60_SPI_PORTNO, ENC28J60_DEVNO); ENC28J60_SPI_PORTNO, ENC28J60_DEVNO);
} }
#endif /* CONFIG_NET_ENC28J60 */ #endif /* CONFIG_NET_ENC28J60 */