mirror of
https://github.com/sakumisu/CherryUSB.git
synced 2025-05-08 16:18:44 +08:00
update(core/usbd_core): implement USB_REQUEST_GET_INTERFACE request, refs:#268
This commit is contained in:
parent
4784017f56
commit
77136aa743
@ -64,6 +64,7 @@ USB_NOCACHE_RAM_SECTION struct usbd_core_priv {
|
||||
bool test_req;
|
||||
#endif
|
||||
struct usbd_interface *intf[16];
|
||||
uint8_t intf_altsetting[16];
|
||||
uint8_t intf_offset;
|
||||
|
||||
struct usbd_tx_rx_msg tx_msg[CONFIG_USBDEV_EP_NUM];
|
||||
@ -710,11 +711,12 @@ static bool usbd_std_interface_req_handler(uint8_t busid, struct usb_setup_packe
|
||||
ret = false;
|
||||
break;
|
||||
case USB_REQUEST_GET_INTERFACE:
|
||||
(*data)[0] = 0;
|
||||
(*data)[0] = g_usbd_core[busid].intf_altsetting[intf_num];
|
||||
*len = 1;
|
||||
break;
|
||||
|
||||
case USB_REQUEST_SET_INTERFACE:
|
||||
g_usbd_core[busid].intf_altsetting[intf_num] = LO_BYTE(setup->wValue);
|
||||
usbd_set_interface(busid, setup->wIndex, setup->wValue);
|
||||
*len = 0;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user