GPIO debug-related fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2767 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
caaae732b3
commit
2e2f22394a
@ -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" />
|
||||
</a>
|
||||
</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>
|
||||
<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_CSRCS = lpc17_allocateheap.c lpc17_clockconfig.c lpc17_gpio.c \
|
||||
lpc17_gpioint.c lpc17_irq.c lpc17_lowputc.c lpc17_serial.c \
|
||||
lpc17_spi.c lpc17_ssp.c lpc17_start.c lpc17_timerisr.c
|
||||
lpc17_irq.c lpc17_lowputc.c lpc17_serial.c lpc17_spi.c \
|
||||
lpc17_ssp.c lpc17_start.c lpc17_timerisr.c
|
||||
|
||||
# Configuration-dependent LPC17xx files
|
||||
|
||||
@ -61,7 +61,7 @@ ifeq ($(CONFIG_GPIO_IRQ),y)
|
||||
CHIP_CSRCS += lpc17_gpioint.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG),y)
|
||||
ifeq ($(CONFIG_DEBUG_GPIO),y)
|
||||
CHIP_CSRCS += lpc17_gpiodbg.c
|
||||
endif
|
||||
|
||||
|
@ -611,8 +611,8 @@ void lpc17_gpiowrite(uint16_t pinset, bool value)
|
||||
offset = LPC17_FIO_SET_OFFSET;
|
||||
}
|
||||
else
|
||||
offset = LPC17_FIO_CLR_OFFSET;
|
||||
{
|
||||
offset = LPC17_FIO_CLR_OFFSET;
|
||||
}
|
||||
putreg32((1 << pin), fiobase + offset);
|
||||
}
|
||||
|
@ -156,12 +156,12 @@ int lpc17_dumpgpio(uint16_t pinset, const char *msg)
|
||||
|
||||
base = g_intbase[port];
|
||||
lldbg(" IOINTSTATUS[%08x]: %08x INTSTATR[%08x]: %08x INSTATF[%08x]: %08x\n",
|
||||
base+LPC17_GPIOINT_IOINTSTATUS_OFFSET, getreg32(base+LPC17_GPIOINT_IOINTSTATUS_OFFSET),
|
||||
base+LPC17_GPIOINT_INTSTATR_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATR_OFFSET),
|
||||
base+LPC17_GPIOINT_INTSTATF_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATF_OFFSET));
|
||||
LPC17_GPIOINT_IOINTSTATUS, getreg32(LPC17_GPIOINT_IOINTSTATUS),
|
||||
base+LPC17_GPIOINT_INTSTATR_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATR_OFFSET),
|
||||
base+LPC17_GPIOINT_INTSTATF_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATF_OFFSET));
|
||||
lldbg(" INTENR[%08x]: %08x INTENF[%08x]: %08x\n",
|
||||
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_INTENR_OFFSET, getreg32(base+LPC17_GPIOINT_INTENR_OFFSET),
|
||||
base+LPC17_GPIOINT_INTENF_OFFSET, getreg32(base+LPC17_GPIOINT_INTENF_OFFSET));
|
||||
irqrestore(flags);
|
||||
return OK;
|
||||
}
|
||||
|
@ -75,16 +75,30 @@
|
||||
* 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
|
||||
# define leddbg lldbg
|
||||
# define ledvdbg llvdbg
|
||||
# ifdef LED_VERBOSE
|
||||
# define ledvdbg lldbg
|
||||
# else
|
||||
# define ledvdbg(x...)
|
||||
# endif
|
||||
#else
|
||||
# undef LED_VERBOSE
|
||||
# define leddbg(x...)
|
||||
# define ledvdbg(x...)
|
||||
#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
|
||||
****************************************************************************/
|
||||
@ -301,12 +315,16 @@ void up_ledinit(void)
|
||||
{
|
||||
/* Configure all LED GPIO lines */
|
||||
|
||||
led_dumpgpio("up_ledinit() Entry)");
|
||||
|
||||
lpc17_configgpio(NUCLEUS2G_LED1_A);
|
||||
lpc17_configgpio(NUCLEUS2G_LED1_B);
|
||||
lpc17_configgpio(NUCLEUS2G_LED2_A);
|
||||
lpc17_configgpio(NUCLEUS2G_LED2_B);
|
||||
lpc17_configgpio(NUCLEUS2G_HEARTBEAT);
|
||||
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_led2(g_led2on[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_led2(g_led2off[led]);
|
||||
up_ledhb(g_ledhboff[led]);
|
||||
|
||||
#ifdef LED_VERBOSE
|
||||
if (led != LED_INIRQ)
|
||||
{
|
||||
led_dumpgpio("up_ledoff() Exit");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARCH_LEDS */
|
||||
|
Loading…
Reference in New Issue
Block a user