diff options
| author | hathach <[email protected]> | 2018-12-05 14:02:48 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-12-05 14:02:48 +0700 |
| commit | cf60b206528fc955bbdd1bfec2c7016a985313ea (patch) | |
| tree | 50411de91abbd898b9f191932dc256dd30637bd6 /src/device/usbd.c | |
| parent | 861e7e6a7982c3e2b7e3c05b566eb06cd32b15c4 (diff) | |
| parent | 734b3ada8a57ca4c8c90a7502c5547a891886481 (diff) | |
Merge pull request #18 from hathach/devlocal
Devlocal
Diffstat (limited to 'src/device/usbd.c')
| -rw-r--r-- | src/device/usbd.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index 81fcfe959..ddb63cebb 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -190,23 +190,26 @@ bool tud_mounted(void) //--------------------------------------------------------------------+
tusb_error_t usbd_init (void)
{
+ // 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);
+
+ // 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
- //------------- Task init -------------//
- _usbd_q = osal_queue_create(&_usbd_qdef);
- TU_VERIFY(_usbd_q, TUSB_ERROR_OSAL_QUEUE_FAILED);
-
- osal_task_create(&_usbd_task_def);
-
- //------------- class init -------------//
- for (uint8_t i = 0; i < USBD_CLASS_DRIVER_COUNT; i++) usbd_class_drivers[i].init();
-
return TUSB_ERROR_NONE;
}
|
