update version to v2.1.2

This commit is contained in:
Artery-MCU
2024-01-25 10:06:54 +08:00
parent 35a0cb1069
commit b8dfb37772
103 changed files with 3348 additions and 235 deletions

View File

@@ -105,6 +105,7 @@ extern "C" {
#define USB_SERIAL_STRING 3 /*!< usb standard string type serial */
#define USB_CONFIG_STRING 4 /*!< usb standard string type config */
#define USB_INTERFACE_STRING 5 /*!< usb standard string type interface */
#define USB_WINUSB_OS_STRING 0xEE /*!< usb microsoft os string */
/**
* @brief usb configuration attributes
@@ -119,6 +120,12 @@ extern "C" {
#define USB_FEATURE_REMOTE_WAKEUP 1 /*!< usb standard feature selectors remote wakeup */
#define USB_FEATURE_TEST_MODE 2 /*!< usb standard feature selectors test mode */
/**
* @brief usb winusb feature id
*/
#define USB_WINUSB_COMPAT_ID 0x04 /*!< usb winusb compat id os descriptor */
#define USB_WINUSB_PROPERTIES_ID 0x05 /*!< usb winusb properties id os descriptor */
/**
* @brief usb device connect state
*/

View File

@@ -82,6 +82,11 @@ typedef struct
usbd_desc_t *(*get_device_serial_string)(void); /*!< get device serial callback */
usbd_desc_t *(*get_device_interface_string)(void); /*!< get device interface string callback */
usbd_desc_t *(*get_device_config_string)(void); /*!< get device device config callback */
#if (USBD_SUPPORT_WINUSB == 1)
usbd_desc_t *(*get_device_winusb_os_string)(void); /*!< get winusb os string */
usbd_desc_t *(*get_device_winusb_os_feature)(void); /*!< get winusb os feature */
usbd_desc_t *(*get_device_winusb_os_property)(void); /*!< get winusb os property */
#endif
}usbd_desc_handler;
/**

View File

@@ -101,6 +101,20 @@ static usb_sts_type usbd_get_descriptor(usbd_core_type *udev)
case USB_INTERFACE_STRING:
desc = udev->desc_handler->get_device_interface_string();
break;
case USB_WINUSB_OS_STRING:
#if (USBD_SUPPORT_WINUSB == 1)
if(udev->desc_handler->get_device_winusb_os_string != NULL)
{
desc = udev->desc_handler->get_device_winusb_os_string();
}
else
{
usbd_ctrl_unsupport(udev);
}
#else
usbd_ctrl_unsupport(udev);
#endif
break;
default:
udev->class_handler->setup_handler(udev, &udev->setup);
return ret;
@@ -243,6 +257,10 @@ static usb_sts_type usbd_set_feature(usbd_core_type *udev)
udev->class_handler->setup_handler(udev, &udev->setup);
usbd_ctrl_send_status(udev);
}
else
{
usbd_ctrl_unsupport(udev);
}
return ret;
}