summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakimisu <[email protected]>2023-01-03 22:38:58 +0800
committersakimisu <[email protected]>2023-01-03 22:38:58 +0800
commit3b5cb7603fc04cba9f0b9da15f3e066b95d159e1 (patch)
treed019b3787178c7c44cb33bb1ba6c30cd6272d02a
parente1585f801c4d0fc20e9b0b968ba8458e85fde3d2 (diff)
ignore get device quality cmd error in full speed
-rw-r--r--core/usbd_core.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/usbd_core.c b/core/usbd_core.c
index 1d4e57b3..f4dfd0ae 100644
--- a/core/usbd_core.c
+++ b/core/usbd_core.c
@@ -884,6 +884,12 @@ static bool usbd_setup_request_handler(struct usb_setup_packet *setup, uint8_t *
switch (setup->bmRequestType & USB_REQUEST_TYPE_MASK) {
case USB_REQUEST_STANDARD:
if (usbd_standard_request_handler(setup, data, len) < 0) {
+#ifndef CONFIG_USB_HS
+ if ((setup->bRequest == 0x06) && (setup->wValue = 0x0600)) {
+ USB_LOG_WRN("Ignore device quality in full speed\r\n");
+ return false;
+ }
+#endif
USB_LOG_ERR("standard request error\r\n");
usbd_print_setup(setup);
return false;
@@ -1012,7 +1018,6 @@ void usbd_event_ep0_setup_complete_handler(uint8_t *psetup)
#if defined(CHERRYUSB_VERSION) && (CHERRYUSB_VERSION > 0x000700)
#else
/* check if the data buf addr matches align size,if not, copy into align buf */
-#ifndef CONFIG_USBDEV_ALIGN_CHECK_DISABLE
if (((unsigned long)usbd_core_cfg.ep0_data_buf) & (CONFIG_USB_ALIGN_SIZE - 1)) {
if (usbd_core_cfg.ep0_data_buf_residue > CONFIG_USBDEV_REQUEST_BUFFER_LEN) {
USB_LOG_ERR("Request buffer too small\r\n");
@@ -1023,7 +1028,6 @@ void usbd_event_ep0_setup_complete_handler(uint8_t *psetup)
usbd_core_cfg.ep0_data_buf = usbd_core_cfg.req_data;
}
#endif
-#endif
/* Send data or status to host */
usbd_ep_start_write(USB_CONTROL_IN_EP0, usbd_core_cfg.ep0_data_buf, usbd_core_cfg.ep0_data_buf_residue);
/*