diff options
| author | hathach <[email protected]> | 2014-03-18 18:38:15 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2014-03-18 18:38:15 +0700 |
| commit | cf82b13a0ef74dca1eebdad577a382af63c82fdc (patch) | |
| tree | 9bbca57e52b767691c9499dc353927b4d00175b8 /demos | |
| parent | eab4f9642c27749a3232f09857079a9c9ab7aeb9 (diff) | |
finish descriptor refractor for hid keyboard & mouse
Diffstat (limited to 'demos')
| -rw-r--r-- | demos/device/src/tusb_config.h | 2 | ||||
| -rw-r--r-- | demos/device/src/tusb_descriptors.c | 12 | ||||
| -rw-r--r-- | demos/device/src/tusb_descriptors.h | 6 |
3 files changed, 7 insertions, 13 deletions
diff --git a/demos/device/src/tusb_config.h b/demos/device/src/tusb_config.h index 8fdd40f5a..a425a7290 100644 --- a/demos/device/src/tusb_config.h +++ b/demos/device/src/tusb_config.h @@ -63,7 +63,7 @@ #define TUSB_CFG_DEVICE_HID_MOUSE 1
#define TUSB_CFG_DEVICE_HID_GENERIC 0 // not supported yet
#define TUSB_CFG_DEVICE_MSC 1
-#define TUSB_CFG_DEVICE_CDC 0
+#define TUSB_CFG_DEVICE_CDC 1
//--------------------------------------------------------------------+
// COMMON CONFIGURATION
diff --git a/demos/device/src/tusb_descriptors.c b/demos/device/src/tusb_descriptors.c index 666f1202e..4ab5b0110 100644 --- a/demos/device/src/tusb_descriptors.c +++ b/demos/device/src/tusb_descriptors.c @@ -43,7 +43,7 @@ //--------------------------------------------------------------------+
#if TUSB_CFG_DEVICE_HID_KEYBOARD
ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
-uint8_t tusbd_hid_keyboard_descriptor_report[] = {
+uint8_t desc_keyboard_report[] = {
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
HID_USAGE ( HID_USAGE_DESKTOP_KEYBOARD ),
HID_COLLECTION ( HID_COLLECTION_APPLICATION ),
@@ -90,7 +90,7 @@ uint8_t tusbd_hid_keyboard_descriptor_report[] = { //--------------------------------------------------------------------+
#if TUSB_CFG_DEVICE_HID_MOUSE
ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
-uint8_t tusbd_hid_mouse_descriptor_report[] = {
+uint8_t desc_mouse_report[] = {
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
HID_USAGE ( HID_USAGE_DESKTOP_MOUSE ),
HID_COLLECTION ( HID_COLLECTION_APPLICATION ),
@@ -316,7 +316,7 @@ app_descriptor_configuration_t desc_configuration = .bCountryCode = HID_Local_NotSupported,
.bNumDescriptors = 1,
.bReportType = HID_DESC_TYPE_REPORT,
- .wReportLength = sizeof(tusbd_hid_keyboard_descriptor_report)
+ .wReportLength = sizeof(desc_keyboard_report)
},
.keyboard_endpoint =
@@ -353,7 +353,7 @@ app_descriptor_configuration_t desc_configuration = .bCountryCode = HID_Local_NotSupported,
.bNumDescriptors = 1,
.bReportType = HID_DESC_TYPE_REPORT,
- .wReportLength = sizeof(tusbd_hid_mouse_descriptor_report)
+ .wReportLength = sizeof(desc_mouse_report)
},
.mouse_endpoint =
@@ -454,10 +454,10 @@ tusbd_descriptor_pointer_t tusbd_descriptor_pointers = },
#if TUSB_CFG_DEVICE_HID_KEYBOARD
- .p_hid_keyboard_report = tusbd_hid_keyboard_descriptor_report,
+ .p_hid_keyboard_report = desc_keyboard_report,
#endif
#if TUSB_CFG_DEVICE_HID_KEYBOARD
- .p_hid_mouse_report = tusbd_hid_mouse_descriptor_report,
+ .p_hid_mouse_report = desc_mouse_report,
#endif
};
diff --git a/demos/device/src/tusb_descriptors.h b/demos/device/src/tusb_descriptors.h index d81a0f51b..31b98de05 100644 --- a/demos/device/src/tusb_descriptors.h +++ b/demos/device/src/tusb_descriptors.h @@ -176,10 +176,4 @@ typedef ATTR_PACKED_STRUCT(struct) } app_descriptor_configuration_t;
-//--------------------------------------------------------------------+
-// Export descriptors
-//--------------------------------------------------------------------+
-extern uint8_t tusbd_hid_keyboard_descriptor_report[];
-extern uint8_t tusbd_hid_mouse_descriptor_report[];
-
#endif
|
