From fd033f25c5fee6a70fdb70e0f01eaec48cf7d0e2 Mon Sep 17 00:00:00 2001 From: sakumisu <1203593632@qq.com> Date: Sat, 25 Jan 2025 16:52:55 +0800 Subject: feat(core/usbh_core): add usbh_printf_setup api for debug Signed-off-by: sakumisu <1203593632@qq.com> --- core/usbh_core.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/usbh_core.c b/core/usbh_core.c index cb36f97e..2f977590 100644 --- a/core/usbh_core.c +++ b/core/usbh_core.c @@ -324,6 +324,17 @@ static void usbh_print_hubport_info(struct usbh_hubport *hport) } } +static void usbh_print_setup(struct usb_setup_packet *setup) +{ + USB_LOG_DBG("Setup: " + "bmRequestType 0x%02x, bRequest 0x%02x, wValue 0x%04x, wIndex 0x%04x, wLength 0x%04x\r\n", + setup->bmRequestType, + setup->bRequest, + setup->wValue, + setup->wIndex, + setup->wLength); +} + static int usbh_get_default_mps(int speed) { switch (speed) { @@ -678,6 +689,8 @@ int usbh_control_transfer(struct usbh_hubport *hport, struct usb_setup_packet *s usb_osal_mutex_take(hport->mutex); + usbh_print_setup(setup); + usbh_control_urb_fill(urb, hport, setup, buffer, setup->wLength, CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT, NULL, NULL); ret = usbh_submit_urb(urb); if (ret == 0) { -- cgit v1.3.1