GPIO debug-related fixes
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@2767 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
parent
4103eb052c
commit
be84093111
|
@ -20,6 +20,10 @@
|
||||||
<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=189573&type=8" width="80" height="15" border="0" alt="Get NuttX at SourceForge.net. Fast, secure and Free Open Source software downloads" />
|
<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=189573&type=8" width="80" height="15" border="0" alt="Get NuttX at SourceForge.net. Fast, secure and Free Open Source software downloads" />
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td width="100" height="100" rowspan="2">
|
||||||
|
<a href="http://download.famouswhy.com/nuttx/" target="_blank">
|
||||||
|
<img src="http://download.famouswhy.com/awards/Famous_Software_Award_Logo.png" alt="NuttX" style="border:0" width="100"></a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" valign="bottom">
|
<td align="left" valign="bottom">
|
||||||
|
|
|
@ -52,8 +52,8 @@ CMN_CSRCS = up_assert.c up_blocktask.c up_copystate.c up_createstack.c \
|
||||||
|
|
||||||
CHIP_ASRCS =
|
CHIP_ASRCS =
|
||||||
CHIP_CSRCS = lpc17_allocateheap.c lpc17_clockconfig.c lpc17_gpio.c \
|
CHIP_CSRCS = lpc17_allocateheap.c lpc17_clockconfig.c lpc17_gpio.c \
|
||||||
lpc17_gpioint.c lpc17_irq.c lpc17_lowputc.c lpc17_serial.c \
|
lpc17_irq.c lpc17_lowputc.c lpc17_serial.c lpc17_spi.c \
|
||||||
lpc17_spi.c lpc17_ssp.c lpc17_start.c lpc17_timerisr.c
|
lpc17_ssp.c lpc17_start.c lpc17_timerisr.c
|
||||||
|
|
||||||
# Configuration-dependent LPC17xx files
|
# Configuration-dependent LPC17xx files
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ ifeq ($(CONFIG_GPIO_IRQ),y)
|
||||||
CHIP_CSRCS += lpc17_gpioint.c
|
CHIP_CSRCS += lpc17_gpioint.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_DEBUG),y)
|
ifeq ($(CONFIG_DEBUG_GPIO),y)
|
||||||
CHIP_CSRCS += lpc17_gpiodbg.c
|
CHIP_CSRCS += lpc17_gpiodbg.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -611,8 +611,8 @@ void lpc17_gpiowrite(uint16_t pinset, bool value)
|
||||||
offset = LPC17_FIO_SET_OFFSET;
|
offset = LPC17_FIO_SET_OFFSET;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
offset = LPC17_FIO_CLR_OFFSET;
|
|
||||||
{
|
{
|
||||||
|
offset = LPC17_FIO_CLR_OFFSET;
|
||||||
}
|
}
|
||||||
putreg32((1 << pin), fiobase + offset);
|
putreg32((1 << pin), fiobase + offset);
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,12 +156,12 @@ int lpc17_dumpgpio(uint16_t pinset, const char *msg)
|
||||||
|
|
||||||
base = g_intbase[port];
|
base = g_intbase[port];
|
||||||
lldbg(" IOINTSTATUS[%08x]: %08x INTSTATR[%08x]: %08x INSTATF[%08x]: %08x\n",
|
lldbg(" IOINTSTATUS[%08x]: %08x INTSTATR[%08x]: %08x INSTATF[%08x]: %08x\n",
|
||||||
base+LPC17_GPIOINT_IOINTSTATUS_OFFSET, getreg32(base+LPC17_GPIOINT_IOINTSTATUS_OFFSET),
|
LPC17_GPIOINT_IOINTSTATUS, getreg32(LPC17_GPIOINT_IOINTSTATUS),
|
||||||
base+LPC17_GPIOINT_INTSTATR_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATR_OFFSET),
|
base+LPC17_GPIOINT_INTSTATR_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATR_OFFSET),
|
||||||
base+LPC17_GPIOINT_INTSTATF_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATF_OFFSET));
|
base+LPC17_GPIOINT_INTSTATF_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATF_OFFSET));
|
||||||
lldbg(" INTENR[%08x]: %08x INTENF[%08x]: %08x\n",
|
lldbg(" INTENR[%08x]: %08x INTENF[%08x]: %08x\n",
|
||||||
base+LPC17_GPIOINT_INTENR_OFFSET, getreg32(base+LPC17_GPIOINT_INTENR_OFFSET),
|
base+LPC17_GPIOINT_INTENR_OFFSET, getreg32(base+LPC17_GPIOINT_INTENR_OFFSET),
|
||||||
base+LPC17_GPIOINT_INTENF_OFFSET, getreg32(base+LPC17_GPIOINT_INTENF_OFFSET));
|
base+LPC17_GPIOINT_INTENF_OFFSET, getreg32(base+LPC17_GPIOINT_INTENF_OFFSET));
|
||||||
irqrestore(flags);
|
irqrestore(flags);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,16 +75,30 @@
|
||||||
* CONFIG_DEBUG_VERBOSE too)
|
* CONFIG_DEBUG_VERBOSE too)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef LED_DEBUG /* Define to enable debug */
|
#undef LED_DEBUG /* Define to enable debug */
|
||||||
|
#undef LED_VERBOSE /* Define to enable verbose debug */
|
||||||
|
|
||||||
#ifdef LED_DEBUG
|
#ifdef LED_DEBUG
|
||||||
# define leddbg lldbg
|
# define leddbg lldbg
|
||||||
# define ledvdbg llvdbg
|
# ifdef LED_VERBOSE
|
||||||
|
# define ledvdbg lldbg
|
||||||
|
# else
|
||||||
|
# define ledvdbg(x...)
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
|
# undef LED_VERBOSE
|
||||||
# define leddbg(x...)
|
# define leddbg(x...)
|
||||||
# define ledvdbg(x...)
|
# define ledvdbg(x...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Dump GPIO registers */
|
||||||
|
|
||||||
|
#ifdef LED_VERBOSE
|
||||||
|
# define led_dumpgpio(m) lpc17_dumpgpio(NUCLEUS2G_LED1_A, m)
|
||||||
|
#else
|
||||||
|
# define led_dumpgpio(m)
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -301,12 +315,16 @@ void up_ledinit(void)
|
||||||
{
|
{
|
||||||
/* Configure all LED GPIO lines */
|
/* Configure all LED GPIO lines */
|
||||||
|
|
||||||
|
led_dumpgpio("up_ledinit() Entry)");
|
||||||
|
|
||||||
lpc17_configgpio(NUCLEUS2G_LED1_A);
|
lpc17_configgpio(NUCLEUS2G_LED1_A);
|
||||||
lpc17_configgpio(NUCLEUS2G_LED1_B);
|
lpc17_configgpio(NUCLEUS2G_LED1_B);
|
||||||
lpc17_configgpio(NUCLEUS2G_LED2_A);
|
lpc17_configgpio(NUCLEUS2G_LED2_A);
|
||||||
lpc17_configgpio(NUCLEUS2G_LED2_B);
|
lpc17_configgpio(NUCLEUS2G_LED2_B);
|
||||||
lpc17_configgpio(NUCLEUS2G_HEARTBEAT);
|
lpc17_configgpio(NUCLEUS2G_HEARTBEAT);
|
||||||
lpc17_configgpio(NUCLEUS2G_EXTRA_LED);
|
lpc17_configgpio(NUCLEUS2G_EXTRA_LED);
|
||||||
|
|
||||||
|
led_dumpgpio("up_ledinit() Exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -318,6 +336,13 @@ void up_ledon(int led)
|
||||||
up_led1(g_led1on[led]);
|
up_led1(g_led1on[led]);
|
||||||
up_led2(g_led2on[led]);
|
up_led2(g_led2on[led]);
|
||||||
up_ledhb(g_ledhbon[led]);
|
up_ledhb(g_ledhbon[led]);
|
||||||
|
|
||||||
|
#ifdef LED_VERBOSE
|
||||||
|
if (led != LED_INIRQ)
|
||||||
|
{
|
||||||
|
led_dumpgpio("up_ledon() Exit");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -329,6 +354,13 @@ void up_ledoff(int led)
|
||||||
up_led1(g_led1off[led]);
|
up_led1(g_led1off[led]);
|
||||||
up_led2(g_led2off[led]);
|
up_led2(g_led2off[led]);
|
||||||
up_ledhb(g_ledhboff[led]);
|
up_ledhb(g_ledhboff[led]);
|
||||||
|
|
||||||
|
#ifdef LED_VERBOSE
|
||||||
|
if (led != LED_INIRQ)
|
||||||
|
{
|
||||||
|
led_dumpgpio("up_ledoff() Exit");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_ARCH_LEDS */
|
#endif /* CONFIG_ARCH_LEDS */
|
||||||
|
|
Loading…
Reference in New Issue