usb: Do not try to print verbose trace when disabled

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.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
This commit is contained in:
Brennan Ashton 2020-11-21 18:53:57 -08:00 committed by Xiang Xiao
parent 0a2873a37f
commit 3ebcd045b5
1 changed files with 9 additions and 2 deletions

View File

@ -170,6 +170,7 @@ void usbhost_trace_common(uint32_t event)
}
}
}
leave_critical_section(flags);
}
#endif /* CONFIG_USBHOST_TRACE */
@ -202,7 +203,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() */
@ -220,7 +224,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() */