Fix some warnings
This commit is contained in:
parent
94f5e87222
commit
eac916c907
@ -43,16 +43,14 @@
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_ERROR
|
||||
# undef CONFIG_DEBUG_WARN
|
||||
# undef CONFIG_DEBUG_INFO
|
||||
# define CONFIG_DEBUG_FEATURES 1
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
#endif
|
||||
#undef CONFIG_DEBUG_FEATURES
|
||||
#undef CONFIG_DEBUG_ERROR
|
||||
#undef CONFIG_DEBUG_WARN
|
||||
#undef CONFIG_DEBUG_INFO
|
||||
#define CONFIG_DEBUG_FEATURES 1
|
||||
#define CONFIG_DEBUG_ERROR 1
|
||||
#define CONFIG_DEBUG_WARN 1
|
||||
#define CONFIG_DEBUG_INFO 1
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
|
@ -39,6 +39,15 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info even if debug output is not selected. */
|
||||
|
||||
#undef CONFIG_DEBUG_ERROR
|
||||
#undef CONFIG_DEBUG_WARN
|
||||
#undef CONFIG_DEBUG_INFO
|
||||
#define CONFIG_DEBUG_ERROR 1
|
||||
#define CONFIG_DEBUG_WARN 1
|
||||
#define CONFIG_DEBUG_INFO 1
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
|
||||
@ -50,18 +59,6 @@
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -83,27 +80,27 @@ void up_dumpnvic(FAR const char *msg)
|
||||
|
||||
flags = enter_critical_section();
|
||||
|
||||
llerr("NVIC: %s\n", msg);
|
||||
llerr(" ISER: %08x ICER: %08x ISPR: %08x ICPR: %08x\n",
|
||||
getreg32(ARMV6M_NVIC_ISER), getreg32(ARMV6M_NVIC_ICER),
|
||||
getreg32(ARMV6M_NVIC_ISPR), getreg32(ARMV6M_NVIC_ICPR));
|
||||
llinfo("NVIC: %s\n", msg);
|
||||
llinfo(" ISER: %08x ICER: %08x ISPR: %08x ICPR: %08x\n",
|
||||
getreg32(ARMV6M_NVIC_ISER), getreg32(ARMV6M_NVIC_ICER),
|
||||
getreg32(ARMV6M_NVIC_ISPR), getreg32(ARMV6M_NVIC_ICPR));
|
||||
|
||||
for (i = 0 ; i < 8; i += 4)
|
||||
{
|
||||
llerr(" IPR%d: %08x IPR%d: %08x IPR%d: %08x IPR%d: %08x\n",
|
||||
i, getreg32(ARMV6M_NVIC_IPR(i)),
|
||||
i+1, getreg32(ARMV6M_NVIC_IPR(i+1)),
|
||||
i+2, getreg32(ARMV6M_NVIC_IPR(i+2)),
|
||||
i+3, getreg32(ARMV6M_NVIC_IPR(i+3)));
|
||||
llinfo(" IPR%d: %08x IPR%d: %08x IPR%d: %08x IPR%d: %08x\n",
|
||||
i, getreg32(ARMV6M_NVIC_IPR(i)),
|
||||
i+1, getreg32(ARMV6M_NVIC_IPR(i+1)),
|
||||
i+2, getreg32(ARMV6M_NVIC_IPR(i+2)),
|
||||
i+3, getreg32(ARMV6M_NVIC_IPR(i+3)));
|
||||
}
|
||||
|
||||
llerr("SYSCON:\n");
|
||||
llerr(" CPUID: %08x ICSR: %08x AIRCR: %08x SCR: %08x\n",
|
||||
getreg32(ARMV6M_SYSCON_CPUID), getreg32(ARMV6M_SYSCON_ICSR),
|
||||
getreg32(ARMV6M_SYSCON_AIRCR), getreg32(ARMV6M_SYSCON_SCR));
|
||||
llerr(" CCR: %08x SHPR2: %08x SHPR3: %08x\n",
|
||||
getreg32(ARMV6M_SYSCON_CCR), getreg32(ARMV6M_SYSCON_SHPR2),
|
||||
getreg32(ARMV6M_SYSCON_SHPR3));
|
||||
llinfo("SYSCON:\n");
|
||||
llinfo(" CPUID: %08x ICSR: %08x AIRCR: %08x SCR: %08x\n",
|
||||
getreg32(ARMV6M_SYSCON_CPUID), getreg32(ARMV6M_SYSCON_ICSR),
|
||||
getreg32(ARMV6M_SYSCON_AIRCR), getreg32(ARMV6M_SYSCON_SCR));
|
||||
llinfo(" CCR: %08x SHPR2: %08x SHPR3: %08x\n",
|
||||
getreg32(ARMV6M_SYSCON_CCR), getreg32(ARMV6M_SYSCON_SHPR2),
|
||||
getreg32(ARMV6M_SYSCON_SHPR3));
|
||||
|
||||
leave_critical_section(flags);
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ static void up_shutdown(struct uart_dev_s *dev);
|
||||
static int up_attach(struct uart_dev_s *dev);
|
||||
static void up_detach(struct uart_dev_s *dev);
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
static int up_interrupte(int irq, void *context);
|
||||
static int up_interrupt(int irq, void *context);
|
||||
#endif
|
||||
static int up_interrupts(int irq, void *context);
|
||||
static int up_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
@ -684,7 +684,7 @@ static int up_attach(struct uart_dev_s *dev)
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (ret == OK)
|
||||
{
|
||||
ret = irq_attach(priv->irqe, up_interrupte);
|
||||
ret = irq_attach(priv->irqe, up_interrupt);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -730,7 +730,7 @@ static void up_detach(struct uart_dev_s *dev)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_interrupte
|
||||
* Name: up_interrupt
|
||||
*
|
||||
* Description:
|
||||
* This is the UART error interrupt handler. It will be invoked when an
|
||||
@ -739,7 +739,7 @@ static void up_detach(struct uart_dev_s *dev)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
static int up_interrupte(int irq, void *context)
|
||||
static int up_interrupt(int irq, void *context)
|
||||
{
|
||||
struct uart_dev_s *dev = NULL;
|
||||
struct up_dev_s *priv;
|
||||
@ -790,6 +790,7 @@ static int up_interrupte(int irq, void *context)
|
||||
{
|
||||
PANIC();
|
||||
}
|
||||
|
||||
priv = (struct up_dev_s *)dev->priv;
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
@ -805,7 +806,11 @@ static int up_interrupte(int irq, void *context)
|
||||
|
||||
regval = up_serialin(priv, KINETIS_UART_S1_OFFSET);
|
||||
llerr("S1: %02x\n", regval);
|
||||
UNUSED(regval);
|
||||
|
||||
regval = up_serialin(priv, KINETIS_UART_D_OFFSET);
|
||||
UNUSED(regval);
|
||||
|
||||
return OK;
|
||||
}
|
||||
#endif /* CONFIG_DEBUG_FEATURES */
|
||||
|
@ -99,7 +99,7 @@
|
||||
# define USB_FRAME_INT 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
# define USB_ERROR_INT USBDEV_INT_ERRINT
|
||||
#else
|
||||
# undef CONFIG_LPC17_USBDEV_REGDEBUG
|
||||
@ -2090,7 +2090,7 @@ static int lpc17_usbinterrupt(int irq, FAR void *context)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
/* USB engine error interrupt */
|
||||
|
||||
if ((devintstatus & USBDEV_INT_ERRINT) != 0)
|
||||
@ -2412,7 +2412,7 @@ static int lpc17_dmasetup(struct lpc17_usbdev_s *priv, uint8_t epphy,
|
||||
struct lpc17_dmadesc_s *dmadesc = priv;
|
||||
uint32_t regval;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!priv || epphy < 2)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -2611,13 +2611,14 @@ static int lpc17_epdisable(FAR struct usbdev_ep_s *ep)
|
||||
uint32_t mask = (1 << privep->epphy);
|
||||
uint32_t regval;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!ep)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_INVALIDPARMS), 0);
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
usbtrace(TRACE_EPDISABLE, privep->epphy);
|
||||
|
||||
/* Cancel any ongoing activity */
|
||||
@ -2653,13 +2654,14 @@ static FAR struct usbdev_req_s *lpc17_epallocreq(FAR struct usbdev_ep_s *ep)
|
||||
{
|
||||
FAR struct lpc17_req_s *privreq;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!ep)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_INVALIDPARMS), 0);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
usbtrace(TRACE_EPALLOCREQ, ((FAR struct lpc17_ep_s *)ep)->epphy);
|
||||
|
||||
privreq = (FAR struct lpc17_req_s *)kmm_malloc(sizeof(struct lpc17_req_s));
|
||||
@ -2685,13 +2687,14 @@ static void lpc17_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s
|
||||
{
|
||||
FAR struct lpc17_req_s *privreq = (FAR struct lpc17_req_s *)req;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!ep || !req)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_INVALIDPARMS), 0);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
usbtrace(TRACE_EPFREEREQ, ((FAR struct lpc17_ep_s *)ep)->epphy);
|
||||
|
||||
kmm_free(privreq);
|
||||
@ -2793,7 +2796,7 @@ static int lpc17_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *r
|
||||
irqstate_t flags;
|
||||
int ret = OK;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!req || !req->callback || !req->buf || !ep)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -2878,7 +2881,7 @@ static int lpc17_epcancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *r
|
||||
FAR struct lpc17_ep_s *privep = (FAR struct lpc17_ep_s *)ep;
|
||||
irqstate_t flags;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!ep || !req)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -3142,7 +3145,7 @@ static int lpc17_selfpowered(struct usbdev_s *dev, bool selfpowered)
|
||||
|
||||
usbtrace(TRACE_DEVSELFPOWERED, (uint16_t)selfpowered);
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!dev)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -3406,7 +3409,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver)
|
||||
|
||||
usbtrace(TRACE_DEVREGISTER, 0);
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!driver || !driver->ops->bind || !driver->ops->unbind ||
|
||||
!driver->ops->disconnect || !driver->ops->setup)
|
||||
{
|
||||
@ -3456,7 +3459,7 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver)
|
||||
{
|
||||
usbtrace(TRACE_DEVUNREGISTER, 0);
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (driver != g_usbdev.driver)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_INVALIDPARMS), 0);
|
||||
|
@ -49,21 +49,10 @@
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: lpc43_pin_dump
|
||||
*
|
||||
|
@ -90,7 +90,7 @@
|
||||
* enabled.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_DEBUG_FEATURES
|
||||
#ifndef CONFIG_DEBUG_USB
|
||||
# undef CONFIG_SAM34_UDP_REGDEBUG
|
||||
#endif
|
||||
|
||||
@ -606,7 +606,7 @@ const struct trace_msg_t g_usb_trace_strings_intdecode[] =
|
||||
#ifdef CONFIG_SAM34_UDP_REGDEBUG
|
||||
static void sam_printreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
|
||||
{
|
||||
llerr("%p%s%08x\n", regaddr, iswrite ? "<-" : "->", regval);
|
||||
llinfo("%p%s%08x\n", regaddr, iswrite ? "<-" : "->", regval);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -657,7 +657,7 @@ static void sam_checkreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
|
||||
{
|
||||
/* No.. More than one. */
|
||||
|
||||
llerr("[repeats %d more times]\n", count);
|
||||
llinfo("[repeats %d more times]\n", count);
|
||||
}
|
||||
}
|
||||
|
||||
@ -732,20 +732,20 @@ static inline void sam_putreg(uint32_t regval, uint32_t regaddr)
|
||||
* Name: sam_dumpep
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_SAM34_UDP_REGDEBUG) && defined(CONFIG_DEBUG_FEATURES)
|
||||
#if defined(CONFIG_SAM34_UDP_REGDEBUG) && defined(CONFIG_DEBUG_USB)
|
||||
static void sam_dumpep(struct sam_usbdev_s *priv, uint8_t epno)
|
||||
{
|
||||
/* Global Registers */
|
||||
|
||||
llerr("Global Registers:\n");
|
||||
llerr(" FRMNUM: %08x\n", sam_getreg(SAM_UDP_FRMNUM));
|
||||
llerr("GLBSTAT: %08x\n", sam_getreg(SAM_UDP_GLBSTAT));
|
||||
llerr(" FADDR: %08x\n", sam_getreg(SAM_UDP_FADDR));
|
||||
llerr(" IMR: %08x\n", sam_getreg(SAM_UDP_IMR));
|
||||
llerr(" ISR: %08x\n", sam_getreg(SAM_UDP_ISR));
|
||||
llerr(" RSTEP: %08x\n", sam_getreg(SAM_UDP_RSTEP));
|
||||
llerr(" TXVC: %08x\n", sam_getreg(SAM_UDP_TXVC));
|
||||
llerr(" CSR[%d]: %08x\n", epno, sam_getreg(SAM_UDPEP_CSR(epno)));
|
||||
llinfo("Global Registers:\n");
|
||||
llinfo(" FRMNUM: %08x\n", sam_getreg(SAM_UDP_FRMNUM));
|
||||
llinfo("GLBSTAT: %08x\n", sam_getreg(SAM_UDP_GLBSTAT));
|
||||
llinfo(" FADDR: %08x\n", sam_getreg(SAM_UDP_FADDR));
|
||||
llinfo(" IMR: %08x\n", sam_getreg(SAM_UDP_IMR));
|
||||
llinfo(" ISR: %08x\n", sam_getreg(SAM_UDP_ISR));
|
||||
llinfo(" RSTEP: %08x\n", sam_getreg(SAM_UDP_RSTEP));
|
||||
llinfo(" TXVC: %08x\n", sam_getreg(SAM_UDP_TXVC));
|
||||
llinfo(" CSR[%d]: %08x\n", epno, sam_getreg(SAM_UDPEP_CSR(epno)));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2891,7 +2891,7 @@ static int sam_ep_configure(struct usbdev_ep_s *ep,
|
||||
|
||||
/* Verify parameters. Endpoint 0 is not available at this interface */
|
||||
|
||||
#if defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_USBDEV_TRACE)
|
||||
#if defined(CONFIG_DEBUG_USB) || defined(CONFIG_USBDEV_TRACE)
|
||||
uint8_t epno = USB_EPNO(desc->addr);
|
||||
usbtrace(TRACE_EPCONFIGURE, (uint16_t)epno);
|
||||
|
||||
@ -2942,7 +2942,7 @@ static int sam_ep_disable(struct usbdev_ep_s *ep)
|
||||
irqstate_t flags;
|
||||
uint8_t epno;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!ep)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -2979,13 +2979,14 @@ static struct usbdev_req_s *sam_ep_allocreq(struct usbdev_ep_s *ep)
|
||||
{
|
||||
struct sam_req_s *privreq;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!ep)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_INVALIDPARMS), 0);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
|
||||
|
||||
privreq = (struct sam_req_s *)kmm_malloc(sizeof(struct sam_req_s));
|
||||
@ -3011,7 +3012,7 @@ static void sam_ep_freereq(struct usbdev_ep_s *ep, struct usbdev_req_s *req)
|
||||
{
|
||||
struct sam_req_s *privreq = (struct sam_req_s *)req;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!ep || !req)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -3074,7 +3075,7 @@ static int sam_ep_submit(struct usbdev_ep_s *ep, struct usbdev_req_s *req)
|
||||
uint8_t epno;
|
||||
int ret = OK;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!req || !req->callback || !req->buf || !ep)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -3086,7 +3087,7 @@ static int sam_ep_submit(struct usbdev_ep_s *ep, struct usbdev_req_s *req)
|
||||
usbtrace(TRACE_EPSUBMIT, USB_EPNO(ep->eplog));
|
||||
priv = privep->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!priv->driver)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_NOTCONFIGURED), priv->usbdev.speed);
|
||||
@ -3182,13 +3183,14 @@ static int sam_ep_cancel(struct usbdev_ep_s *ep, struct usbdev_req_s *req)
|
||||
struct sam_ep_s *privep = (struct sam_ep_s *)ep;
|
||||
irqstate_t flags;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!ep || !req)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_INVALIDPARMS), 0);
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
usbtrace(TRACE_EPCANCEL, USB_EPNO(ep->eplog));
|
||||
|
||||
flags = enter_critical_section();
|
||||
@ -3208,7 +3210,7 @@ static int sam_ep_stallresume(struct usbdev_ep_s *ep, bool resume)
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!ep)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -3283,7 +3285,8 @@ static struct usbdev_ep_s *sam_allocep(struct usbdev_s *dev, uint8_t epno,
|
||||
uint16_t epset = SAM_EPSET_NOTEP0;
|
||||
|
||||
usbtrace(TRACE_DEVALLOCEP, (uint16_t)epno);
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!dev)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -3345,13 +3348,14 @@ static void sam_freeep(struct usbdev_s *dev, struct usbdev_ep_s *ep)
|
||||
struct sam_usbdev_s *priv;
|
||||
struct sam_ep_s *privep;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!dev || !ep)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_INVALIDPARMS), 0);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
priv = (struct sam_usbdev_s *)dev;
|
||||
privep = (struct sam_ep_s *)ep;
|
||||
usbtrace(TRACE_DEVFREEEP, (uint16_t)USB_EPNO(ep->eplog));
|
||||
@ -3377,7 +3381,7 @@ static int sam_getframe(struct usbdev_s *dev)
|
||||
uint32_t regval;
|
||||
uint16_t frameno;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!dev)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -3409,7 +3413,8 @@ static int sam_wakeup(struct usbdev_s *dev)
|
||||
uint32_t regval;
|
||||
|
||||
usbtrace(TRACE_DEVWAKEUP, 0);
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!dev)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -3480,7 +3485,7 @@ static int sam_selfpowered(struct usbdev_s *dev, bool selfpowered)
|
||||
|
||||
usbtrace(TRACE_DEVSELFPOWERED, (uint16_t)selfpowered);
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!dev)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -3926,7 +3931,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver)
|
||||
|
||||
usbtrace(TRACE_DEVREGISTER, 0);
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (!driver || !driver->ops->bind || !driver->ops->unbind ||
|
||||
!driver->ops->disconnect || !driver->ops->setup)
|
||||
{
|
||||
@ -4000,7 +4005,7 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver)
|
||||
|
||||
usbtrace(TRACE_DEVUNREGISTER, 0);
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
if (driver != priv->driver)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_INVALIDPARMS), 0);
|
||||
|
@ -2835,7 +2835,7 @@ errout:
|
||||
|
||||
static int sam_epfree(struct usbhost_driver_s *drvr, usbhost_ep_t ep)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_ASSERTIONS
|
||||
struct sam_rhport_s *rhport = (struct sam_rhport_s *)drvr;
|
||||
#endif
|
||||
struct sam_eplist_s *eplist = (struct sam_eplist_s *)ep;
|
||||
|
@ -1650,7 +1650,7 @@ static inline int sam_single(struct sam_xdmach_s *xdmach)
|
||||
static inline int sam_multiple(struct sam_xdmach_s *xdmach)
|
||||
{
|
||||
struct sam_xdmac_s *xdmac = sam_controller(xdmach);
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_ASSERTIONS
|
||||
struct chnext_view1_s *llhead = xdmach->llhead;
|
||||
#endif
|
||||
uintptr_t paddr;
|
||||
|
@ -68,14 +68,6 @@
|
||||
# define HAVE_SERCOM0_4
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -162,9 +154,9 @@ void sercom_slowclk_configure(int sercom, int gclkgen)
|
||||
#ifdef CONFIG_SAMDL_SERCOM5
|
||||
static bool configured5 = false;
|
||||
#endif
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_ASSERTIONS
|
||||
#ifdef HAVE_SERCOM0_4
|
||||
static uint8_t slowgen = 0xff;
|
||||
static uint8_t slowgen04 = 0xff;
|
||||
#endif
|
||||
#ifdef CONFIG_SAMDL_SERCOM5
|
||||
static uint8_t slowgen5 = 0xff;
|
||||
@ -205,19 +197,19 @@ void sercom_slowclk_configure(int sercom, int gclkgen)
|
||||
*/
|
||||
|
||||
configured = true;
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
slowgen = (uint8_t)gclkgen;
|
||||
#ifdef CONFIG_DEBUG_ASSERTIONS
|
||||
slowgen04 = (uint8_t)gclkgen;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_ASSERTIONS
|
||||
/* Already configured. This is okay provided that the same GCLK
|
||||
* generator is being used. Otherwise, there is a problem.
|
||||
*/
|
||||
|
||||
else
|
||||
{
|
||||
DEBUGASSERT((int)slowgen == gclkgen);
|
||||
DEBUGASSERT((int)slowgen04 == gclkgen);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
@ -236,12 +228,12 @@ void sercom_slowclk_configure(int sercom, int gclkgen)
|
||||
*/
|
||||
|
||||
configured5 = true;
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_ASSERTIONS
|
||||
slowgen5 = (uint8_t)gclkgen;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_ASSERTIONS
|
||||
/* Already configured. This is okay provided that the same GCLK
|
||||
* generator is being used. Otherwise, there is a problem.
|
||||
*/
|
||||
|
@ -1340,7 +1340,7 @@ static inline int sam_single(struct sam_xdmach_s *xdmach)
|
||||
static inline int sam_multiple(struct sam_xdmach_s *xdmach)
|
||||
{
|
||||
struct sam_xdmac_s *xdmac = sam_controller(xdmach);
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_ASSERTIONS
|
||||
struct chnext_view1_s *llhead = xdmach->llhead;
|
||||
#endif
|
||||
uintptr_t paddr;
|
||||
|
@ -39,6 +39,15 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info even if debug output is not selected. */
|
||||
|
||||
#undef CONFIG_DEBUG_ERROR
|
||||
#undef CONFIG_DEBUG_WARN
|
||||
#undef CONFIG_DEBUG_INFO
|
||||
#define CONFIG_DEBUG_ERROR 1
|
||||
#define CONFIG_DEBUG_WARN 1
|
||||
#define CONFIG_DEBUG_INFO 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <debug.h>
|
||||
@ -163,13 +172,13 @@ int tiva_dumpgpio(uint32_t pinset, const char *msg)
|
||||
enabled = ((rcgc2 & SYSCON_RCGC2_GPIO(port)) != 0);
|
||||
#endif
|
||||
|
||||
llerr("GPIO%c pinset: %08x base: %08x -- %s\n",
|
||||
llinfo("GPIO%c pinset: %08x base: %08x -- %s\n",
|
||||
tiva_gpioport(port), pinset, base, msg);
|
||||
#ifdef TIVA_SYSCON_RCGCGPIO
|
||||
llerr("RCGCGPIO: %08x (%s)\n",
|
||||
llinfo("RCGCGPIO: %08x (%s)\n",
|
||||
rcgcgpio, enabled ? "enabled" : "disabled");
|
||||
#else
|
||||
llerr(" RCGC2: %08x (%s)\n",
|
||||
llinfo(" RCGC2: %08x (%s)\n",
|
||||
rcgc2, enabled ? "enabled" : "disabled");
|
||||
#endif
|
||||
|
||||
@ -177,17 +186,17 @@ int tiva_dumpgpio(uint32_t pinset, const char *msg)
|
||||
|
||||
if (enabled)
|
||||
{
|
||||
llerr(" AFSEL: %02x DEN: %02x DIR: %02x DATA: %02x\n",
|
||||
getreg32(base + TIVA_GPIO_AFSEL_OFFSET), getreg32(base + TIVA_GPIO_DEN_OFFSET),
|
||||
getreg32(base + TIVA_GPIO_DIR_OFFSET), getreg32(base + TIVA_GPIO_DATA_OFFSET + 0x3fc));
|
||||
llerr(" IS: %02x IBE: %02x IEV: %02x IM: %02x RIS: %08x MIS: %08x\n",
|
||||
getreg32(base + TIVA_GPIO_IEV_OFFSET), getreg32(base + TIVA_GPIO_IM_OFFSET),
|
||||
getreg32(base + TIVA_GPIO_RIS_OFFSET), getreg32(base + TIVA_GPIO_MIS_OFFSET));
|
||||
llerr(" 2MA: %02x 4MA: %02x 8MA: %02x ODR: %02x PUR %02x PDR: %02x SLR: %02x\n",
|
||||
getreg32(base + TIVA_GPIO_DR2R_OFFSET), getreg32(base + TIVA_GPIO_DR4R_OFFSET),
|
||||
getreg32(base + TIVA_GPIO_DR8R_OFFSET), getreg32(base + TIVA_GPIO_ODR_OFFSET),
|
||||
getreg32(base + TIVA_GPIO_PUR_OFFSET), getreg32(base + TIVA_GPIO_PDR_OFFSET),
|
||||
getreg32(base + TIVA_GPIO_SLR_OFFSET));
|
||||
llinfo(" AFSEL: %02x DEN: %02x DIR: %02x DATA: %02x\n",
|
||||
getreg32(base + TIVA_GPIO_AFSEL_OFFSET), getreg32(base + TIVA_GPIO_DEN_OFFSET),
|
||||
getreg32(base + TIVA_GPIO_DIR_OFFSET), getreg32(base + TIVA_GPIO_DATA_OFFSET + 0x3fc));
|
||||
llinfo(" IS: %02x IBE: %02x IEV: %02x IM: %02x RIS: %08x MIS: %08x\n",
|
||||
getreg32(base + TIVA_GPIO_IEV_OFFSET), getreg32(base + TIVA_GPIO_IM_OFFSET),
|
||||
getreg32(base + TIVA_GPIO_RIS_OFFSET), getreg32(base + TIVA_GPIO_MIS_OFFSET));
|
||||
llinfo(" 2MA: %02x 4MA: %02x 8MA: %02x ODR: %02x PUR %02x PDR: %02x SLR: %02x\n",
|
||||
getreg32(base + TIVA_GPIO_DR2R_OFFSET), getreg32(base + TIVA_GPIO_DR4R_OFFSET),
|
||||
getreg32(base + TIVA_GPIO_DR8R_OFFSET), getreg32(base + TIVA_GPIO_ODR_OFFSET),
|
||||
getreg32(base + TIVA_GPIO_PUR_OFFSET), getreg32(base + TIVA_GPIO_PDR_OFFSET),
|
||||
getreg32(base + TIVA_GPIO_SLR_OFFSET));
|
||||
}
|
||||
|
||||
leave_critical_section(flags);
|
||||
|
@ -116,14 +116,14 @@
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG_FEATURES
|
||||
# define message(...) lib_lowprintf(__VA_ARGS__)
|
||||
# ifdef CONFIG_DEBUG_INFO
|
||||
# define message(...) llinfo(__VA_ARGS__)
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG_FEATURES
|
||||
# define message lib_lowprintf
|
||||
# define message llinfo
|
||||
# else
|
||||
# define message printf
|
||||
# endif
|
||||
|
@ -306,7 +306,7 @@ static inline int stmpe811_waitsample(FAR struct stmpe811_dev_s *priv,
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#if defined(CONFIG_DEBUG_INPUT_ERROR) || defined(CONFIG_DEBUG_ASSERTIONS)
|
||||
/* Sample the errno (debug output could change it) */
|
||||
|
||||
int errval = errno;
|
||||
|
@ -167,7 +167,7 @@ static inline int syslog_takesem(void)
|
||||
|
||||
static inline void syslog_givesem(void)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_ASSERTIONS
|
||||
pid_t me = getpid();
|
||||
DEBUGASSERT(g_sysdev.sl_holder == me);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user