/* USB Device Endpoint 0 Event Callback - WinUSB specific handling (Setup Request To Device) Parameters: none Return Value: TRUE - Setup vendor request ok, FALSE - Setup vendor request not supported  */
__WEAK BOOL USBD_EndPoint0_Setup_WinUSB_ReqToDevice(void)
/* USB Device Endpoint 0 Event Callback - WinUSB specific handling (Setup Request To Device) Parameters: none Return Value: TRUE - Setup vendor request ok, FALSE - Setup vendor request not supported  */
__WEAK BOOL USBD_EndPoint0_Setup_WinUSB_ReqToDevice(void)
{
    U8  *pD;
    U32 len;
    BOOL success = (__FALSE);
    if (USBD_SetupPacket.bRequest == usbd_winusb_vendor_code) {
        switch (USBD_SetupPacket.wIndex) {
            case WINUSB_REQUEST_GET_DESCRIPTOR_SET:
                pD = (U8 *)USBD_WinUSBDescriptorSetDescriptor;
                USBD_EP0Data.pData = pD;
                len = ((WINUSB_DESCRIPTOR_SET_HEADER *)pD)->wTotalLength;
                success = (__TRUE);
                break;
            default:
                break;
        }
    }
    if (success) {
        if (len < USBD_SetupPacket.wLength) {
            USBD_EP0Data.Count = len;
            if (!(len & (usbd_max_packet0 - 1))) {
                USBD_ZLP = 1;
            }
        } else {
            USBD_EP0Data.Count = USBD_SetupPacket.wLength;
        }
        USBD_DataInStage();
    }
    return success;
}