From 62f8c14fae1c7c2f7d5cd5246e18f305d638f5f6 Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 3 Nov 2019 14:08:38 +0700 Subject: [PATCH] add a bit of log1 for debugging --- src/device/usbd.c | 4 +++- src/osal/osal_none.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/device/usbd.c b/src/device/usbd.c index 0b9713e9..99741690 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -376,7 +376,7 @@ void tud_task (void) case DCD_EVENT_SETUP_RECEIVED: TU_LOG2(" "); - TU_LOG2_MEM(&event.setup_received, 1, 8); + TU_LOG1_MEM(&event.setup_received, 1, 8); // Mark as connected after receiving 1st setup packet. // But it is easier to set it every time instead of wasting time to check then set @@ -385,6 +385,7 @@ void tud_task (void) // Process control request if ( !process_control_request(event.rhport, &event.setup_received) ) { + TU_LOG1(" Stall EP0\r\n"); // Failed -> stall both control endpoint IN and OUT dcd_edpt_stall(event.rhport, 0); dcd_edpt_stall(event.rhport, 0 | TUSB_DIR_IN_MASK); @@ -404,6 +405,7 @@ void tud_task (void) if ( 0 == epnum ) { + TU_LOG1(" EP Addr = 0x%02X, len = %ld\r\n", ep_addr, event.xfer_complete.len); usbd_control_xfer_cb(event.rhport, ep_addr, event.xfer_complete.result, event.xfer_complete.len); } else diff --git a/src/osal/osal_none.h b/src/osal/osal_none.h index fa581215..5868dfb3 100644 --- a/src/osal/osal_none.h +++ b/src/osal/osal_none.h @@ -198,6 +198,8 @@ static inline bool osal_queue_send(osal_queue_t const qhdl, void const * data, b _osal_q_unlock(qhdl); } + TU_ASSERT(success); + return success; }