summaryrefslogtreecommitdiff
path: root/src/device/usbd.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-04-26 22:02:41 +0700
committerhathach <[email protected]>2020-04-26 22:02:49 +0700
commita1c599f4b6a05aefb948aaacf9a0984f577252bb (patch)
treef6dc022dbcf04e555a4849c0cf580e0537445a3c /src/device/usbd.c
parentd54343e4a6bc84549caf69ecd26a98852127ef3f (diff)
clean up log message
Diffstat (limited to 'src/device/usbd.c')
-rw-r--r--src/device/usbd.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index f0b7fcefc..1f660f0f2 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -232,15 +232,15 @@ bool usbd_control_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t event,
#if CFG_TUSB_DEBUG >= 2
static char const* const _usbd_event_str[DCD_EVENT_COUNT] =
{
- "INVALID" ,
- "BUS_RESET" ,
- "UNPLUGGED" ,
+ "Invalid" ,
+ "Bus Reset" ,
+ "Unplugged" ,
"SOF" ,
- "SUSPEND" ,
- "RESUME" ,
- "SETUP_RECEIVED" ,
- "XFER_COMPLETE" ,
- "FUNC_CALL"
+ "Suspend" ,
+ "Resume" ,
+ "Setup Received" ,
+ "Xfer Complete" ,
+ "Func Call"
};
static char const* const _tusb_std_request_str[] =
@@ -260,6 +260,19 @@ static char const* const _tusb_std_request_str[] =
"Synch Frame"
};
+// for usbd_control to print the name of control complete driver
+void usbd_driver_print_control_complete_name(bool (*control_complete) (uint8_t, tusb_control_request_t const * ))
+{
+ for (uint8_t i = 0; i < USBD_CLASS_DRIVER_COUNT; i++)
+ {
+ if (_usbd_driver[i].control_complete == control_complete )
+ {
+ TU_LOG2(" %s control complete\r\n", _usbd_driver[i].name);
+ return;
+ }
+ }
+}
+
#endif
//--------------------------------------------------------------------+
@@ -356,7 +369,7 @@ void tud_task (void)
if ( !osal_queue_receive(_usbd_q, &event) ) return;
- TU_LOG2("USBD: %s", event.event_id < DCD_EVENT_COUNT ? _usbd_event_str[event.event_id] : "CORRUPTED");
+ TU_LOG2("USBD %s", event.event_id < DCD_EVENT_COUNT ? _usbd_event_str[event.event_id] : "CORRUPTED");
TU_LOG2("%s", (event.event_id != DCD_EVENT_XFER_COMPLETE && event.event_id != DCD_EVENT_SETUP_RECEIVED) ? "\r\n" : " ");
switch ( event.event_id )