0
0
Fork 0

fix address-of-packed-member warning of usb_handle

This commit is contained in:
kerms 2023-12-18 21:13:58 +08:00
parent 24b5f60b34
commit 5dd9b9dad8
1 changed files with 3 additions and 3 deletions

View File

@ -174,8 +174,8 @@ void handleUSBControlRequest(usbip_stage2_header *header)
break; break;
case 0xC0: // Microsoft OS 2.0 vendor-specific descriptor case 0xC0: // Microsoft OS 2.0 vendor-specific descriptor
{ {
uint16_t *wIndex = (uint16_t *)(&(header->u.cmd_submit.request.wIndex)); uint16_t wIndex = header->u.cmd_submit.request.wIndex.u16;
switch (*wIndex) switch (wIndex)
{ {
case MS_OS_20_DESCRIPTOR_INDEX: case MS_OS_20_DESCRIPTOR_INDEX:
os_printf("* GET MSOS 2.0 vendor-specific descriptor\r\n"); os_printf("* GET MSOS 2.0 vendor-specific descriptor\r\n");
@ -189,7 +189,7 @@ void handleUSBControlRequest(usbip_stage2_header *header)
default: default:
os_printf("USB unknown request, bmRequestType:%d,bRequest:%d,wIndex:%d\r\n", 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;
} }
break; break;