diff --git a/components/USBIP/usb_handle.c b/components/USBIP/usb_handle.c index c1aebbc..3cdc60e 100644 --- a/components/USBIP/usb_handle.c +++ b/components/USBIP/usb_handle.c @@ -174,8 +174,8 @@ void handleUSBControlRequest(usbip_stage2_header *header) break; case 0xC0: // Microsoft OS 2.0 vendor-specific descriptor { - uint16_t *wIndex = (uint16_t *)(&(header->u.cmd_submit.request.wIndex)); - switch (*wIndex) + uint16_t wIndex = header->u.cmd_submit.request.wIndex.u16; + switch (wIndex) { case MS_OS_20_DESCRIPTOR_INDEX: os_printf("* GET MSOS 2.0 vendor-specific descriptor\r\n"); @@ -189,7 +189,7 @@ void handleUSBControlRequest(usbip_stage2_header *header) default: os_printf("USB unknown request, bmRequestType:%d,bRequest:%d,wIndex:%d\r\n", - header->u.cmd_submit.request.bmRequestType, header->u.cmd_submit.request.bRequest, *wIndex); + header->u.cmd_submit.request.bmRequestType, header->u.cmd_submit.request.bRequest, wIndex); break; } break;