diff options
| author | hathach <[email protected]> | 2012-11-29 15:35:59 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2012-11-29 15:35:59 +0700 |
| commit | 360b28b44fa2ad7973f06c7f048a66a68e6cb90f (patch) | |
| tree | a80ef4f6ba6282faa2fd13cc18689667f47626e9 /tinyusb/device/dcd.c | |
| parent | 382cd30be2e3069a490977e1a492783188a02da0 (diff) | |
add more doxygen docs
start to use TUSB_Error_t
Diffstat (limited to 'tinyusb/device/dcd.c')
| -rw-r--r-- | tinyusb/device/dcd.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tinyusb/device/dcd.c b/tinyusb/device/dcd.c index 2802c0299..84109af2c 100644 --- a/tinyusb/device/dcd.c +++ b/tinyusb/device/dcd.c @@ -57,7 +57,7 @@ ErrorCode_t USB_Configure_Event (USBD_HANDLE_T hUsb) if (pCtrl->config_value) { #if defined(CLASS_HID) - ASSERT_STATUS( usb_hid_configured(hUsb) ); + ASSERT( tERROR_NONE == usb_hid_configured(hUsb), ERR_FAILED ); #endif #ifdef CFG_USB_CDC @@ -81,7 +81,7 @@ ErrorCode_t USB_Reset_Event (USBD_HANDLE_T hUsb) return LPC_OK; } -void dcd_init() +TUSB_Error_t dcd_init() { /* ROM DRIVER INIT */ uint32_t membase = (uint32_t) usb_RomDriver_buffer; @@ -107,26 +107,26 @@ void dcd_init() .device_qualifier = NULL }; - /* Start USB hardware initialisation */ - ASSERT_STATUS(USBD_API->hw->Init(&g_hUsb, &DeviceDes, &usb_param)); + /* USB hardware core initialization */ + ASSERT(LPC_OK == USBD_API->hw->Init(&g_hUsb, &DeviceDes, &usb_param), tERROR_FAILED); membase += (memsize - usb_param.mem_size); memsize = usb_param.mem_size; /* Initialise the class driver(s) */ - #ifdef CFG_USB_CDC - ASSERT_STATUS( usb_cdc_init(g_hUsb, &USB_FsConfigDescriptor.CDC_CCI_Interface, + #ifdef CFG_CLASS_CDC + ASSERT_ERROR( usb_cdc_init(g_hUsb, &USB_FsConfigDescriptor.CDC_CCI_Interface, &USB_FsConfigDescriptor.CDC_DCI_Interface, &membase, &memsize) ); #endif #ifdef CFG_CLASS_HID_KEYBOARD - ASSERT_STATUS( usb_hid_init(g_hUsb , &USB_FsConfigDescriptor.HID_KeyboardInterface , + ASSERT_ERROR( usb_hid_init(g_hUsb , &USB_FsConfigDescriptor.HID_KeyboardInterface , HID_KeyboardReportDescriptor, USB_FsConfigDescriptor.HID_KeyboardHID.DescriptorList[0].wDescriptorLength, &membase , &memsize) ); #endif - #ifdef CFG_USB_HID_MOUSE - ASSERT_STATUS( usb_hid_init(g_hUsb , &USB_FsConfigDescriptor.HID_MouseInterface , + #ifdef CFG_CLASS_HID_MOUSE + ASSERT_ERROR( usb_hid_init(g_hUsb , &USB_FsConfigDescriptor.HID_MouseInterface , HID_MouseReportDescriptor, USB_FsConfigDescriptor.HID_MouseHID.DescriptorList[0].wDescriptorLength, &membase , &memsize) ); #endif @@ -136,6 +136,8 @@ void dcd_init() /* Perform USB soft connect */ USBD_API->hw->Connect(g_hUsb, 1); + + return tERROR_NONE; } /**************************************************************************/ |
