diff options
| author | hathach <[email protected]> | 2013-01-19 00:57:58 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-01-19 00:57:58 +0700 |
| commit | cfe7a3d23b4639c3578b166fc865450bc439d82c (patch) | |
| tree | 7a831618538324b04bfd9e0f918a78a0aea92b34 /tinyusb/class | |
| parent | d8c8b9e38ad94ab84c24f22c2ecb79ce4d78b7ba (diff) | |
change error type to lower case for more consistency
change Error Enum to TUSB prefix for more consistency
start to add check for OS configure
Diffstat (limited to 'tinyusb/class')
| -rw-r--r-- | tinyusb/class/cdc.c | 8 | ||||
| -rw-r--r-- | tinyusb/class/cdc.h | 4 | ||||
| -rw-r--r-- | tinyusb/class/hid.c | 16 | ||||
| -rw-r--r-- | tinyusb/class/hid_device.h | 8 |
4 files changed, 18 insertions, 18 deletions
diff --git a/tinyusb/class/cdc.c b/tinyusb/class/cdc.c index 0c59b0186..246e08d57 100644 --- a/tinyusb/class/cdc.c +++ b/tinyusb/class/cdc.c @@ -265,7 +265,7 @@ ErrorCode_t CDC_BulkOut_Hdlr(USBD_HANDLE_T hUsb, void* data, uint32_t event) @brief Initialises USB CDC using the ROM driver */ /**************************************************************************/ -TUSB_Error_t tusb_cdc_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *const pControlIntfDesc, USB_INTERFACE_DESCRIPTOR const *const pDataIntfDesc, uint32_t* mem_base, uint32_t* mem_size) +tusb_error_t tusb_cdc_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *const pControlIntfDesc, USB_INTERFACE_DESCRIPTOR const *const pDataIntfDesc, uint32_t* mem_base, uint32_t* mem_size) { USBD_CDC_INIT_PARAM_T cdc_param = { @@ -296,7 +296,7 @@ TUSB_Error_t tusb_cdc_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *c *mem_base = cdc_param.mem_base; *mem_size = cdc_param.mem_size; - return tERROR_NONE; + return TUSB_ERROR_NONE; } /**************************************************************************/ @@ -304,7 +304,7 @@ TUSB_Error_t tusb_cdc_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *c @brief TODO Add description */ /**************************************************************************/ -TUSB_Error_t tusb_cdc_configured(USBD_HANDLE_T hUsb) +tusb_error_t tusb_cdc_configured(USBD_HANDLE_T hUsb) { uint8_t dummy=0; USBD_API->hw->WriteEP(hUsb, CDC_DATA_EP_IN, &dummy, 1); // initial packet for IN endpoint, will not work if omitted @@ -323,7 +323,7 @@ TUSB_Error_t tusb_cdc_configured(USBD_HANDLE_T hUsb) #error No MCU defined // TODO asbtract MCU #endif - return tERROR_NONE; + return TUSB_ERROR_NONE; } #endif diff --git a/tinyusb/class/cdc.h b/tinyusb/class/cdc.h index e4660d9b0..a33ec594b 100644 --- a/tinyusb/class/cdc.h +++ b/tinyusb/class/cdc.h @@ -101,7 +101,7 @@ uint16_t tusb_cdc_recv(uint8_t* buffer, uint16_t max); * \return Error Code of the \ref TUSB_ERROR enum * \note */ -TUSB_Error_t tusb_cdc_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *const pControlIntfDesc, USB_INTERFACE_DESCRIPTOR const *const pDataIntfDesc, uint32_t* mem_base, uint32_t* mem_size); +tusb_error_t tusb_cdc_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *const pControlIntfDesc, USB_INTERFACE_DESCRIPTOR const *const pDataIntfDesc, uint32_t* mem_base, uint32_t* mem_size); /** \brief notify cdc driver that usb is configured * @@ -110,7 +110,7 @@ TUSB_Error_t tusb_cdc_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *c * \return Error Code of the \ref TUSB_ERROR enum * \note */ -TUSB_Error_t tusb_cdc_configured(USBD_HANDLE_T hUsb); +tusb_error_t tusb_cdc_configured(USBD_HANDLE_T hUsb); #endif #endif diff --git a/tinyusb/class/hid.c b/tinyusb/class/hid.c index dceb4d7db..167d57b9d 100644 --- a/tinyusb/class/hid.c +++ b/tinyusb/class/hid.c @@ -179,7 +179,7 @@ ErrorCode_t HID_EpOut_Hdlr (USBD_HANDLE_T hUsb, void* data, uint32_t event) @brief Initialises USB HID using the ROM based drivers */ /**************************************************************************/ -TUSB_Error_t tusb_hid_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *const pIntfDesc, uint8_t const * const pHIDReportDesc, uint32_t ReportDescLength, uint32_t* mem_base, uint32_t* mem_size) +tusb_error_t tusb_hid_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *const pIntfDesc, uint8_t const * const pHIDReportDesc, uint32_t ReportDescLength, uint32_t* mem_base, uint32_t* mem_size) { USB_HID_REPORT_T reports_data = { @@ -212,7 +212,7 @@ TUSB_Error_t tusb_hid_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *c *mem_base += (*mem_size - hid_param.mem_size); *mem_size = hid_param.mem_size; - return tERROR_NONE; + return TUSB_ERROR_NONE; } /**************************************************************************/ @@ -220,7 +220,7 @@ TUSB_Error_t tusb_hid_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *c */ /**************************************************************************/ -TUSB_Error_t tusb_hid_configured(USBD_HANDLE_T hUsb) +tusb_error_t tusb_hid_configured(USBD_HANDLE_T hUsb) { #ifdef TUSB_CFG_DEVICE_HID_KEYBOARD USBD_API->hw->WriteEP(hUsb , HID_KEYBOARD_EP_IN , (uint8_t* ) &hid_keyboard_report , sizeof(tusb_keyboard_report_t) ); // initial packet for IN endpoint , will not work if omitted @@ -230,7 +230,7 @@ TUSB_Error_t tusb_hid_configured(USBD_HANDLE_T hUsb) USBD_API->hw->WriteEP(hUsb , HID_MOUSE_EP_IN , (uint8_t* ) &hid_mouse_report , sizeof(USB_HID_MouseReport_t) ); // initial packet for IN endpoint, will not work if omitted #endif - return tERROR_NONE; + return TUSB_ERROR_NONE; } #ifdef TUSB_CFG_DEVICE_HID_KEYBOARD @@ -270,7 +270,7 @@ TUSB_Error_t tusb_hid_configured(USBD_HANDLE_T hUsb) @endcode */ /**************************************************************************/ -TUSB_Error_t tusb_hid_keyboard_sendKeys(uint8_t modifier, uint8_t keycodes[], uint8_t numkey) +tusb_error_t tusb_hid_keyboard_sendKeys(uint8_t modifier, uint8_t keycodes[], uint8_t numkey) { // uint32_t start_time = systickGetSecondsActive(); // while (bKeyChanged) // TODO blocking while previous key has yet sent - can use fifo to improve this @@ -291,7 +291,7 @@ TUSB_Error_t tusb_hid_keyboard_sendKeys(uint8_t modifier, uint8_t keycodes[], ui bKeyChanged = true; - return tERROR_NONE; + return TUSB_ERROR_NONE; } #endif @@ -321,7 +321,7 @@ TUSB_Error_t tusb_hid_keyboard_sendKeys(uint8_t modifier, uint8_t keycodes[], ui @endcode */ /**************************************************************************/ -TUSB_Error_t tusb_hid_mouse_send(uint8_t buttons, int8_t x, int8_t y) +tusb_error_t tusb_hid_mouse_send(uint8_t buttons, int8_t x, int8_t y) { // uint32_t start_time = systickGetSecondsActive(); // while (bMouseChanged) // TODO Block while previous key hasn't been sent - can use fifo to improve this @@ -340,7 +340,7 @@ TUSB_Error_t tusb_hid_mouse_send(uint8_t buttons, int8_t x, int8_t y) bMouseChanged = true; - return tERROR_NONE; + return TUSB_ERROR_NONE; } #endif diff --git a/tinyusb/class/hid_device.h b/tinyusb/class/hid_device.h index 31c3a489f..41bcb8fe7 100644 --- a/tinyusb/class/hid_device.h +++ b/tinyusb/class/hid_device.h @@ -65,7 +65,7 @@ * \return Error Code of the \ref TUSB_ERROR enum * \note */ -TUSB_Error_t tusb_hid_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *const pIntfDesc, uint8_t const * const pHIDReportDesc, uint32_t ReportDescLength, uint32_t* mem_base, uint32_t* mem_size); +tusb_error_t tusb_hid_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *const pIntfDesc, uint8_t const * const pHIDReportDesc, uint32_t ReportDescLength, uint32_t* mem_base, uint32_t* mem_size); /** \brief Notify HID class that usb is configured * @@ -74,7 +74,7 @@ TUSB_Error_t tusb_hid_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *c * \return Error Code of the \ref TUSB_ERROR enum * \note */ -TUSB_Error_t tusb_hid_configured(USBD_HANDLE_T hUsb); +tusb_error_t tusb_hid_configured(USBD_HANDLE_T hUsb); /** \brief Used by Application to send Keycode to Host * @@ -83,7 +83,7 @@ TUSB_Error_t tusb_hid_configured(USBD_HANDLE_T hUsb); * \return Error Code of the \ref TUSB_ERROR enum * \note */ -TUSB_Error_t tusb_hid_keyboard_sendKeys(uint8_t modifier, uint8_t keycodes[], uint8_t numkey); +tusb_error_t tusb_hid_keyboard_sendKeys(uint8_t modifier, uint8_t keycodes[], uint8_t numkey); /** \brief * @@ -92,7 +92,7 @@ TUSB_Error_t tusb_hid_keyboard_sendKeys(uint8_t modifier, uint8_t keycodes[], ui * \return Error Code of the \ref TUSB_ERROR enum * \note */ -TUSB_Error_t tusb_hid_mouse_send(uint8_t buttons, int8_t x, int8_t y); +tusb_error_t tusb_hid_mouse_send(uint8_t buttons, int8_t x, int8_t y); #endif /* ROM DRIVRER */ |
