/* Reset control endpoint. 
Called after a USB line reset or when UDD is enabled  */
static void udd_reset_ep_ctrl(void)
/* Reset control endpoint. 
Called after a USB line reset or when UDD is enabled  */
static void udd_reset_ep_ctrl(void)
{
	irqflags_t flags;
	udd_configure_address(0);
	udd_enable_address();
	udd_configure_endpoint(0,
			USB_EP_TYPE_CONTROL,
			0,
			USB_DEVICE_EP_CTRL_SIZE,
			UDPHS_EPTCFG_BK_NUMBER_1 >> UDPHS_EPTCFG_BK_NUMBER_Pos,
			0);
	dbg_print("rst(0:%08x) ", UDPHS->UDPHS_EPT[0].UDPHS_EPTCFG);
	udd_enable_endpoint(0);
	flags = cpu_irq_save();
	udd_enable_setup_received_interrupt(0);
	udd_enable_out_received_interrupt(0);
	udd_enable_endpoint_interrupt(0);
	cpu_irq_restore(flags);
}