/* Handle set the alternate setting of a interface request. 
This function is used to handle set the alternate setting of a interface request. */
static usb_status_t USB_DeviceCh9SetInterface(usb_device_handle handle, usb_setup_struct_t *setup, uint8_t **buffer, uint32_t *length)
/* Handle set the alternate setting of a interface request. 
This function is used to handle set the alternate setting of a interface request. */
static usb_status_t USB_DeviceCh9SetInterface(usb_device_handle handle, usb_setup_struct_t *setup, uint8_t **buffer, uint32_t *length)
{
    uint8_t state;
    USB_DeviceGetStatus(handle, kUSB_DeviceStatusDeviceState, &state);
    if (state != kUSB_DeviceStateConfigured)
    {
        return kStatus_USB_InvalidRequest;
    }
    return USB_DeviceSetInterface(handle, (setup->wIndex & 0xFFU), (setup->wValue & 0xFFU));
}