Skip to content

Commit

Permalink
update(core/usbd_core): implement USB_REQUEST_GET_INTERFACE request
Browse files Browse the repository at this point in the history
  • Loading branch information
sakumisu committed Oct 28, 2024
1 parent 3fb005a commit 32f4aa6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/usbd_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -703,11 +704,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;
Expand Down

0 comments on commit 32f4aa6

Please sign in to comment.