diff options
| author | hathach <[email protected]> | 2012-12-04 14:12:48 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2012-12-04 14:12:48 +0700 |
| commit | 82820a206666a6415148b0d26985ac5c7a9eb279 (patch) | |
| tree | 1b283af44b02506b332df29620d2f760a5375d3e /tinyusb/class | |
| parent | 8f00307986b71fdc48210e0ee4821a95392be4c3 (diff) | |
able to build with lpc43xx demo
Diffstat (limited to 'tinyusb/class')
| -rw-r--r-- | tinyusb/class/cdc.c | 2 | ||||
| -rw-r--r-- | tinyusb/class/cdc.h | 3 | ||||
| -rw-r--r-- | tinyusb/class/hid.c | 2 | ||||
| -rw-r--r-- | tinyusb/class/hid.h | 18 |
4 files changed, 15 insertions, 10 deletions
diff --git a/tinyusb/class/cdc.c b/tinyusb/class/cdc.c index d62b7aa7d..a163be13a 100644 --- a/tinyusb/class/cdc.c +++ b/tinyusb/class/cdc.c @@ -38,7 +38,7 @@ #include "cdc.h" #include "common/fifo.h" -#ifdef CFG_CLASS_CDC +#if defined CFG_CLASS_CDC && defined CFG_TUSB_DEVICE static USBD_HANDLE_T g_hCdc; static CDC_LINE_CODING line_coding; diff --git a/tinyusb/class/cdc.h b/tinyusb/class/cdc.h index 5bcad17a0..e4660d9b0 100644 --- a/tinyusb/class/cdc.h +++ b/tinyusb/class/cdc.h @@ -93,6 +93,7 @@ uint16_t tusb_cdc_send(uint8_t* buffer, uint16_t count); */ uint16_t tusb_cdc_recv(uint8_t* buffer, uint16_t max); +#ifdef DEVICE_ROMDRIVER /** \brief initialize cdc driver * * \param[in] para1 @@ -111,3 +112,5 @@ TUSB_Error_t tusb_cdc_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *c */ 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 76a93d572..659765c1a 100644 --- a/tinyusb/class/hid.c +++ b/tinyusb/class/hid.c @@ -37,7 +37,7 @@ #include "hid.h" -#ifdef TUSB_CLASS_HID +#if defined TUSB_CLASS_HID && defined CFG_TUSB_DEVICE #ifdef CFG_CLASS_HID_KEYBOARD USB_HID_KeyboardReport_t hid_keyboard_report; diff --git a/tinyusb/class/hid.h b/tinyusb/class/hid.h index 4e56ffb4e..b5516e259 100644 --- a/tinyusb/class/hid.h +++ b/tinyusb/class/hid.h @@ -51,6 +51,10 @@ #ifndef _TUSB_HID_H_ #define _TUSB_HID_H_ +#ifdef __cplusplus + extern "C" { +#endif + // TODO refractor #include "common/common.h" #include "device/dcd.h" @@ -61,24 +65,24 @@ * * Type define for a standard Boot Protocol Mouse report */ -typedef PRE_PACK struct +typedef ATTR_PREPACKED struct { uint8_t Button; /**< Button mask for currently pressed buttons in the mouse. */ int8_t X; /**< Current delta X movement of the mouse. */ int8_t Y; /**< Current delta Y movement on the mouse. */ -} POST_PACK USB_HID_MouseReport_t; +} ATTR_PACKED USB_HID_MouseReport_t; /** \struct USB_HID_KeyboardReport_t * \brief Standard HID Boot Protocol Keyboard Report. * * Type define for a standard Boot Protocol Keyboard report */ -typedef PRE_PACK struct +typedef ATTR_PREPACKED struct { uint8_t Modifier; /**< Keyboard modifier byte, indicating pressed modifier keys (a combination of HID_KEYBOARD_MODIFER_* masks). */ uint8_t Reserved; /**< Reserved for OEM use, always set to 0. */ uint8_t KeyCode[6]; /**< Key codes of the currently pressed keys. */ -} POST_PACK USB_HID_KeyboardReport_t; +} ATTR_PACKED USB_HID_KeyboardReport_t; /** \enum USB_HID_MOUSE_BUTTON_CODE * \brief Button codes for HID mouse @@ -148,10 +152,7 @@ enum USB_HID_LOCAL_CODE HID_Local_Turkish_F }; -#ifdef __cplusplus - extern "C" { -#endif - +#ifdef DEVICE_ROMDRIVER /** \brief Initialize HID driver * * \param[in] para1 @@ -187,6 +188,7 @@ TUSB_Error_t tusb_hid_keyboard_sendKeys(uint8_t modifier, uint8_t keycodes[], ui * \note */ TUSB_Error_t tusb_hid_mouse_send(uint8_t buttons, int8_t x, int8_t y); +#endif #ifdef __cplusplus } |
