Skip to content

Commit

Permalink
usb: Do not try to print verbose trace when disabled
Browse files Browse the repository at this point in the history
Right now if usb tracing is enabled but verbose is disabled
a debug assert will be triggered when ever a verbose trace point
is hit.  Instead of trying to print the NULL message, just return
early.
  • Loading branch information
btashton committed Nov 23, 2020
1 parent 0a2873a commit afd3f49
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/usbhost/usbhost_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ void usbhost_trace1(uint16_t id, uint32_t u23)
/* Get the format associated with the trace */

fmt = usbhost_trformat1(id);
DEBUGASSERT(fmt);
if (fmt == NULL)
{
return;
}

/* Just print the data using syslog() */

Expand All @@ -220,7 +223,10 @@ void usbhost_trace2(uint16_t id, uint8_t u7, uint16_t u16)
/* Get the format associated with the trace */

fmt = usbhost_trformat2(id);
DEBUGASSERT(fmt);
if (fmt == NULL)
{
return;
}

/* Just print the data using syslog() */

Expand Down

0 comments on commit afd3f49

Please sign in to comment.