hal clean up

- replace tusb_hal_int_enable/disable to dcd_int_enable/disable,
hcd_int_enable/disable
- remove tusb_hal_init(), this will be part of dcd_init/hcd_init,
anything beyond dcd/hcd should be inited by bsp
This commit is contained in:
hathach
2018-12-05 13:20:25 +07:00
parent 6048a3bff4
commit a73017fdc2
17 changed files with 125 additions and 290 deletions

View File

@@ -190,23 +190,26 @@ bool tud_mounted(void)
//--------------------------------------------------------------------+
tusb_error_t usbd_init (void)
{
#if (CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE)
dcd_init(0);
#endif
#if (CFG_TUSB_RHPORT1_MODE & OPT_MODE_DEVICE)
dcd_init(1);
#endif
//------------- Task init -------------//
// Init device queue & task
_usbd_q = osal_queue_create(&_usbd_qdef);
TU_VERIFY(_usbd_q, TUSB_ERROR_OSAL_QUEUE_FAILED);
osal_task_create(&_usbd_task_def);
//------------- class init -------------//
// Init class drivers
for (uint8_t i = 0; i < USBD_CLASS_DRIVER_COUNT; i++) usbd_class_drivers[i].init();
// Init device controller driver
#if (CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE)
dcd_init(0);
dcd_int_enable(0);
#endif
#if (CFG_TUSB_RHPORT1_MODE & OPT_MODE_DEVICE)
dcd_init(1);
dcd_int_enable(1);
#endif
return TUSB_ERROR_NONE;
}