port: hpmicro: separate host and device USB instance config
- separate host and device USB instance config Signed-off-by: Zhihong Chen <zhihong.chen@hpmicro.com>
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
#define USB_NUM_BIDIR_ENDPOINTS USB_SOC_DCD_MAX_ENDPOINT_COUNT
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_HPM_USB_BASE) || !defined(CONFIG_HPM_USB_IRQn)
|
||||
#error "hpm dcd must config CONFIG_HPM_USB_BASE and CONFIG_HPM_USB_IRQn"
|
||||
#if !defined(CONFIG_HPM_USBD_BASE) || !defined(CONFIG_HPM_USBD_IRQn)
|
||||
#error "hpm dcd must config CONFIG_HPM_USBD_BASE and CONFIG_HPM_USBD_IRQn"
|
||||
#endif
|
||||
|
||||
/* USBSTS, USBINTR */
|
||||
@@ -66,7 +66,7 @@ int usb_dc_init(void)
|
||||
|
||||
memset(&g_hpm_udc, 0, sizeof(struct hpm_udc));
|
||||
g_hpm_udc.handle = &usb_device_handle[0];
|
||||
g_hpm_udc.handle->regs = (USB_Type *)CONFIG_HPM_USB_BASE;
|
||||
g_hpm_udc.handle->regs = (USB_Type *)CONFIG_HPM_USBD_BASE;
|
||||
g_hpm_udc.handle->dcd_data = &_dcd_data;
|
||||
|
||||
uint32_t int_mask;
|
||||
@@ -75,7 +75,7 @@ int usb_dc_init(void)
|
||||
|
||||
usb_device_init(g_hpm_udc.handle, int_mask);
|
||||
|
||||
intc_m_enable_irq(CONFIG_HPM_USB_IRQn);
|
||||
intc_m_enable_irq(CONFIG_HPM_USBD_IRQn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -287,4 +287,4 @@ void isr_usb(void)
|
||||
{
|
||||
USBD_IRQHandler();
|
||||
}
|
||||
SDK_DECLARE_EXT_ISR_M(CONFIG_HPM_USB_IRQn, isr_usb)
|
||||
SDK_DECLARE_EXT_ISR_M(CONFIG_HPM_USBD_IRQn, isr_usb)
|
||||
|
||||
Reference in New Issue
Block a user