summaryrefslogtreecommitdiff
path: root/src/device/usbd_control.c
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2023-07-20 18:30:09 +0700
committerGitHub <[email protected]>2023-07-20 18:30:09 +0700
commit17576a6949ced2fa7febca0d90da2f8afc8b6913 (patch)
treea10a2a3f2efafe45b25dfd847515266f70110748 /src/device/usbd_control.c
parent6c7c9f2ef5a80d5a6879e9c3558162188c6cf889 (diff)
parent16ad918d96b2bd01189906d64d0871f0ea952833 (diff)
Merge pull request #2156 from hathach/usbh-xfer-user-callback
Usbh xfer user callback
Diffstat (limited to 'src/device/usbd_control.c')
-rw-r--r--src/device/usbd_control.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/device/usbd_control.c b/src/device/usbd_control.c
index 2afe967b5..c580e6ecf 100644
--- a/src/device/usbd_control.c
+++ b/src/device/usbd_control.c
@@ -32,10 +32,7 @@
#include "tusb.h"
#include "device/usbd_pvt.h"
-// Debug level of USBD Control
-#define USBD_CONTROL_DEBUG 2
-
-#if CFG_TUSB_DEBUG >= USBD_CONTROL_DEBUG
+#if CFG_TUSB_DEBUG >= CFG_TUD_LOG_LEVEL
extern void usbd_driver_print_control_complete_name(usbd_control_xfer_cb_t callback);
#endif
@@ -191,7 +188,7 @@ bool usbd_control_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result
{
TU_VERIFY(_ctrl_xfer.buffer);
memcpy(_ctrl_xfer.buffer, _usbd_ctrl_buf, xferred_bytes);
- TU_LOG_MEM(USBD_CONTROL_DEBUG, _usbd_ctrl_buf, xferred_bytes, 2);
+ TU_LOG_MEM(CFG_TUD_LOG_LEVEL, _usbd_ctrl_buf, xferred_bytes, 2);
}
_ctrl_xfer.total_xferred += (uint16_t) xferred_bytes;
@@ -208,7 +205,7 @@ bool usbd_control_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result
// callback can still stall control in status phase e.g out data does not make sense
if ( _ctrl_xfer.complete_cb )
{
- #if CFG_TUSB_DEBUG >= USBD_CONTROL_DEBUG
+ #if CFG_TUSB_DEBUG >= CFG_TUD_LOG_LEVEL
usbd_driver_print_control_complete_name(_ctrl_xfer.complete_cb);
#endif