/* USB device configuration changed event call back. Here we reconfigure the USB end points.  */
void EVENT_USB_Device_ConfigurationChanged()
/* USB device configuration changed event call back. Here we reconfigure the USB end points.  */
void EVENT_USB_Device_ConfigurationChanged()
{
	uint8_t i;
	for (i = 1;i < USB_runtime.usbd_max_num_eps;i++)
	{
		device.Endpoints[i].IsConfigured = 0;
	}
	USBD_SetEndpointBuffer(WinUSBInfo.Config.InEndpoint.Address,tx_buf,TX_BUF_SIZE);
	USBD_SetEndpointBuffer(WinUSBInfo.Config.OutEndpoint.Address,rx_buf,RX_BUF_SIZE);
	USBD_WINUSB_ConfigureEndpoints(&WinUSBInfo);
	for (i = 1;i < USB_runtime.usbd_max_num_eps;i++)
	{
		USBD_Endpoint_t *ep = &device.Endpoints[i];
		if ((0U == ep->IsConfigured) && (1U == ep->IsEnabled))
		{
			device.Driver->EndpointUnconfigure(ep->Number);
		}
	}
	device.IsConfigured = 1;
	USB_DeviceState = DEVICE_STATE_Configured;
}