コード例 #1
0
ファイル: usbdev_trace.c プロジェクト: a1ien/nuttx
void usbtrace(uint16_t event, uint16_t value)
{
  irqstate_t flags;

  /* Check if tracing is enabled for this ID */

  flags = enter_critical_section();
  if ((g_maskedidset & TRACE_ID2BIT(event)) != 0)
    {
#ifdef CONFIG_USBDEV_TRACE
      /* Yes... save the new trace data at the head */

      g_trace[g_head].event = event;
      g_trace[g_head].value = value;

      /* Increment the head and (probably) the tail index */

      if (++g_head >= CONFIG_USBDEV_TRACE_NRECORDS)
        {
          g_head = 0;
        }

      if (g_head == g_tail)
        {
          if (++g_tail >= CONFIG_USBDEV_TRACE_NRECORDS)
            {
              g_tail = 0;
            }
        }
#else
      /* Just print the data using syslog */

      usbtrace_trprintf(usbtrace_syslog, event, value);
#endif
    }

  leave_critical_section(flags);
}
コード例 #2
0
ファイル: up_assert.c プロジェクト: a1ien/nuttx
static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
{
  usbtrace_trprintf(usbtrace_syslog, trace->event, trace->value);
  return 0;
}
コード例 #3
0
static int assert_tracecallback(struct usbtrace_s *trace, void *arg)
{
  usbtrace_trprintf((trprintf_t)lowsyslog, trace->event, trace->value);
  return 0;
}
コード例 #4
0
ファイル: usbterm_main.c プロジェクト: hll4fork/nuttx-apps
static int trace_callback(struct usbtrace_s *trace, void *arg)
{
  usbtrace_trprintf((trprintf_t)trmessage, trace->event, trace->value);
  return 0;
}