mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Tiva: Remove unconditional debug output from GPIO code
This commit is contained in:
@@ -734,13 +734,13 @@ static inline void tiva_interrupt(uint32_t pinset)
|
|||||||
|
|
||||||
#ifdef CONFIG_DEBUG_GPIO
|
#ifdef CONFIG_DEBUG_GPIO
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
vdbg("reg expected actual: [interrupt type=%d]\n", inttype);
|
gpiovdbg("reg expected actual: [interrupt type=%d]\n", inttype);
|
||||||
regval = (getreg32(base+TIVA_GPIO_IS_OFFSET) & pin) ? pin : 0;
|
regval = (getreg32(base+TIVA_GPIO_IS_OFFSET) & pin) ? pin : 0;
|
||||||
vdbg("IS 0x%08x 0x%08x\n", isset, regval);
|
gpiovdbg("IS 0x%08x 0x%08x\n", isset, regval);
|
||||||
regval = (getreg32(base+TIVA_GPIO_IBE_OFFSET) & pin) ? pin : 0;
|
regval = (getreg32(base+TIVA_GPIO_IBE_OFFSET) & pin) ? pin : 0;
|
||||||
vdbg("IBE 0x%08x 0x%08x\n", ibeset, regval);
|
gpiovdbg("IBE 0x%08x 0x%08x\n", ibeset, regval);
|
||||||
regval = (getreg32(base+TIVA_GPIO_IEV_OFFSET) & pin) ? pin : 0;
|
regval = (getreg32(base+TIVA_GPIO_IEV_OFFSET) & pin) ? pin : 0;
|
||||||
vdbg("IEV 0x%08x 0x%08x\n", ievset, regval);
|
gpiovdbg("IEV 0x%08x 0x%08x\n", ievset, regval);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -988,14 +988,14 @@ void tiva_gpio_lockport(uint32_t pinset, bool lock)
|
|||||||
if (lock)
|
if (lock)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_DEBUG_GPIO
|
#ifdef CONFIG_DEBUG_GPIO
|
||||||
vdbg(" locking port=%d pin=%d\n", port, pinno);
|
gpiovdbg(" locking port=%d pin=%d\n", port, pinno);
|
||||||
#endif
|
#endif
|
||||||
modifyreg32(base + TIVA_GPIO_CR_OFFSET, pinmask, 0);
|
modifyreg32(base + TIVA_GPIO_CR_OFFSET, pinmask, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_DEBUG_GPIO
|
#ifdef CONFIG_DEBUG_GPIO
|
||||||
vdbg("unlocking port=%d pin=%d\n", port, pinno);
|
gpiovdbg("unlocking port=%d pin=%d\n", port, pinno);
|
||||||
#endif
|
#endif
|
||||||
modifyreg32(base + TIVA_GPIO_CR_OFFSET, 0, pinmask);
|
modifyreg32(base + TIVA_GPIO_CR_OFFSET, 0, pinmask);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
#include <nuttx/irq.h>
|
#include <nuttx/irq.h>
|
||||||
|
|
||||||
@@ -322,6 +323,20 @@
|
|||||||
# define GPIO_PIN_6 (6 << GPIO_PIN_SHIFT)
|
# define GPIO_PIN_6 (6 << GPIO_PIN_SHIFT)
|
||||||
# define GPIO_PIN_7 (7 << GPIO_PIN_SHIFT)
|
# define GPIO_PIN_7 (7 << GPIO_PIN_SHIFT)
|
||||||
|
|
||||||
|
/* Debug ********************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_DEBUG_SCHED
|
||||||
|
# define gpiodbg(format, ...) dbg(format, ##__VA_ARGS__)
|
||||||
|
# define gpiolldbg(format, ...) lldbg(format, ##__VA_ARGS__)
|
||||||
|
# define gpiovdbg(format, ...) vdbg(format, ##__VA_ARGS__)
|
||||||
|
# define gpiollvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
# define gpiodbg(x...)
|
||||||
|
# define gpiolldbg(x...)
|
||||||
|
# define gpiovdbg(x...)
|
||||||
|
# define gpiollvdbg(x...)
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ static int tiva_gpioporthandler(uint8_t port, void *context)
|
|||||||
uint8_t pin; /* Pin number */
|
uint8_t pin; /* Pin number */
|
||||||
|
|
||||||
tiva_gpioirqclear(port, 0xff);
|
tiva_gpioirqclear(port, 0xff);
|
||||||
llvdbg("mis=0b%08b\n", mis & 0xff);
|
gpiollvdbg("mis=0b%08b\n", mis & 0xff);
|
||||||
|
|
||||||
/* Now process each IRQ pending in the MIS */
|
/* Now process each IRQ pending in the MIS */
|
||||||
|
|
||||||
@@ -304,10 +304,10 @@ static int tiva_gpioporthandler(uint8_t port, void *context)
|
|||||||
{
|
{
|
||||||
if (((mis >> pin) & 1) != 0)
|
if (((mis >> pin) & 1) != 0)
|
||||||
{
|
{
|
||||||
llvdbg("port=%d pin=%d irq=%p index=%d\n",
|
gpiollvdbg("port=%d pin=%d irq=%p index=%d\n",
|
||||||
port, pin,
|
port, pin,
|
||||||
g_gpioportirqvector[TIVA_GPIO_IRQ_IDX(port, pin)],
|
g_gpioportirqvector[TIVA_GPIO_IRQ_IDX(port, pin)],
|
||||||
TIVA_GPIO_IRQ_IDX(port, pin));
|
TIVA_GPIO_IRQ_IDX(port, pin));
|
||||||
|
|
||||||
g_gpioportirqvector[TIVA_GPIO_IRQ_IDX(port, pin)](irq, context);
|
g_gpioportirqvector[TIVA_GPIO_IRQ_IDX(port, pin)](irq, context);
|
||||||
}
|
}
|
||||||
@@ -561,8 +561,8 @@ int tiva_gpioirqinitialize(void)
|
|||||||
g_gpioportirqvector[i] = irq_unexpected_isr;
|
g_gpioportirqvector[i] = irq_unexpected_isr;
|
||||||
}
|
}
|
||||||
|
|
||||||
vdbg("tiva_gpioirqinitialize isr=%d/%d irq_unexpected_isr=%p\n",
|
gpiovdbg("tiva_gpioirqinitialize isr=%d/%d irq_unexpected_isr=%p\n",
|
||||||
i, TIVA_NIRQ_PINS, irq_unexpected_isr);
|
i, TIVA_NIRQ_PINS, irq_unexpected_isr);
|
||||||
|
|
||||||
/* Then attach each GPIO interrupt handlers and enable corresponding GPIO
|
/* Then attach each GPIO interrupt handlers and enable corresponding GPIO
|
||||||
* interrupts
|
* interrupts
|
||||||
@@ -693,8 +693,8 @@ xcpt_t tiva_gpioirqattach(uint32_t pinset, xcpt_t isr)
|
|||||||
* to the unexpected interrupt handler.
|
* to the unexpected interrupt handler.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
vdbg("assign port=%d pin=%d function=%p to idx=%d\n",
|
gpiovdbg("assign port=%d pin=%d function=%p to idx=%d\n",
|
||||||
port, pinno, isr, TIVA_GPIO_IRQ_IDX(port, pinno));
|
port, pinno, isr, TIVA_GPIO_IRQ_IDX(port, pinno));
|
||||||
|
|
||||||
if (isr == NULL)
|
if (isr == NULL)
|
||||||
{
|
{
|
||||||
@@ -738,7 +738,7 @@ void tiva_gpioportirqattach(uint8_t port, xcpt_t isr)
|
|||||||
* to the unexpected interrupt handler.
|
* to the unexpected interrupt handler.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
vdbg("assign function=%p to port=%d\n", isr, port);
|
gpiovdbg("assign function=%p to port=%d\n", isr, port);
|
||||||
|
|
||||||
if (isr == NULL)
|
if (isr == NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1026,10 +1026,10 @@ static int ssi_interrupt(int irq, void *context)
|
|||||||
|
|
||||||
/* Check for Rx FIFO overruns */
|
/* Check for Rx FIFO overruns */
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef SSI_DEBUG
|
||||||
if ((regval & SSI_RIS_ROR) != 0)
|
if ((regval & SSI_RIS_ROR) != 0)
|
||||||
{
|
{
|
||||||
lldbg("Rx FIFO Overrun!\n");
|
ssidbg("Rx FIFO Overrun!\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -3049,4 +3049,3 @@ void tiva_timer16_relmatch(TIMER_HANDLE handle, uint32_t relmatch, int tmndx)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user