summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2025-01-25 16:52:55 +0800
committersakumisu <[email protected]>2025-01-25 19:08:15 +0800
commitfd033f25c5fee6a70fdb70e0f01eaec48cf7d0e2 (patch)
treee470bbbf882cfcb326d26291b24e72d93b5087c3
parent3e9f2b7777eba75bcefec24a43be68618e4f9698 (diff)
feat(core/usbh_core): add usbh_printf_setup api for debug
Signed-off-by: sakumisu <[email protected]>
-rw-r--r--core/usbh_core.c13
1 files changed, 13 insertions, 0 deletions
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) {