summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2012-12-20 16:59:43 +0700
committerhathach <[email protected]>2012-12-20 16:59:43 +0700
commit8c2ec83c592234ec423137a2df710adb6b967aef (patch)
treec4f6226b38f305708831b5d636cd214d38d2e2d6
parentf9aee110636c877faf2662f2bc3def92d06fe021 (diff)
rename macro configure in examples
-rw-r--r--demos/device/keyboard/descriptors.c12
-rw-r--r--demos/device/keyboard/descriptors.h14
-rw-r--r--demos/device/keyboard/main.c12
3 files changed, 19 insertions, 19 deletions
diff --git a/demos/device/keyboard/descriptors.c b/demos/device/keyboard/descriptors.c
index 929ec17f2..c7ab9d9c1 100644
--- a/demos/device/keyboard/descriptors.c
+++ b/demos/device/keyboard/descriptors.c
@@ -37,7 +37,7 @@
#include "descriptors.h"
-#ifdef CFG_CLASS_HID_KEYBOARD
+#ifdef TUSB_CFG_DEVICE_HID_KEYBOARD
ATTR_ALIGNED(4) const uint8_t HID_KeyboardReportDescriptor[] = {
HID_UsagePage ( HID_USAGE_PAGE_GENERIC ),
HID_Usage ( HID_USAGE_GENERIC_KEYBOARD ),
@@ -80,7 +80,7 @@ ATTR_ALIGNED(4) const uint8_t HID_KeyboardReportDescriptor[] = {
};
#endif
-#ifdef CFG_CLASS_HID_MOUSE
+#ifdef TUSB_CFG_DEVICE_HID_MOUSE
ATTR_ALIGNED(4) const uint8_t HID_MouseReportDescriptor[] = {
HID_UsagePage ( HID_USAGE_PAGE_GENERIC ),
HID_Usage ( HID_USAGE_GENERIC_MOUSE ),
@@ -130,7 +130,7 @@ ATTR_ALIGNED(4) const USB_DEVICE_DESCRIPTOR USB_DeviceDescriptor =
.bDeviceClass = USB_DEVICE_CLASS_IAD,
.bDeviceSubClass = USB_DEVICE_SUBCLASS_IAD,
.bDeviceProtocol = USB_DEVICE_PROTOCOL_IAD,
- #elif defined CFG_CLASS_CDC
+ #elif defined TUSB_CFG_DEVICE_CDC
.bDeviceClass = CDC_COMMUNICATION_INTERFACE_CLASS,
.bDeviceSubClass = 0x00,
.bDeviceProtocol = 0x00,
@@ -187,7 +187,7 @@ ATTR_ALIGNED(4) const USB_FS_CONFIGURATION_DESCRIPTOR USB_FsConfigDescriptor =
},
#endif
- #ifdef CFG_CLASS_CDC
+ #ifdef TUSB_CFG_DEVICE_CDC
// USB CDC Serial Interface
// CDC Control Interface
.CDC_CCI_Interface =
@@ -276,7 +276,7 @@ ATTR_ALIGNED(4) const USB_FS_CONFIGURATION_DESCRIPTOR USB_FsConfigDescriptor =
},
#endif
- #ifdef CFG_CLASS_HID_KEYBOARD
+ #ifdef TUSB_CFG_DEVICE_HID_KEYBOARD
///// USB HID Keyboard interface
.HID_KeyboardInterface =
{
@@ -316,7 +316,7 @@ ATTR_ALIGNED(4) const USB_FS_CONFIGURATION_DESCRIPTOR USB_FsConfigDescriptor =
},
#endif
- #ifdef CFG_CLASS_HID_MOUSE
+ #ifdef TUSB_CFG_DEVICE_HID_MOUSE
.HID_MouseInterface =
{
.bLength = sizeof(USB_INTERFACE_DESCRIPTOR),
diff --git a/demos/device/keyboard/descriptors.h b/demos/device/keyboard/descriptors.h
index 1200192b5..0fa68af10 100644
--- a/demos/device/keyboard/descriptors.h
+++ b/demos/device/keyboard/descriptors.h
@@ -67,21 +67,21 @@ typedef PRE_PACK struct POST_PACK _USB_STR_DESCRIPTOR
///////////////////////////////////////////////////////////////////////
// Interface Assosication Descriptor if device is CDC + other class
-#define IAD_DESC_REQUIRED ( defined(CFG_CLASS_CDC) && (TUSB_CLASS_HID) )
+#define IAD_DESC_REQUIRED ( defined(TUSB_CFG_DEVICE_CDC) && (DEVICE_CLASS_HID) )
-#ifdef CFG_CLASS_CDC
+#ifdef TUSB_CFG_DEVICE_CDC
#define INTERFACES_OF_CDC 2
#else
#define INTERFACES_OF_CDC 0
#endif
-#ifdef CFG_CLASS_HID_KEYBOARD
+#ifdef TUSB_CFG_DEVICE_HID_KEYBOARD
#define INTERFACES_OF_HID_KEYBOARD 1
#else
#define INTERFACES_OF_HID_KEYBOARD 0
#endif
-#ifdef CFG_CLASS_HID_MOUSE
+#ifdef TUSB_CFG_DEVICE_HID_MOUSE
#define INTERFACES_OF_HID_MOUSE 1
#else
#define INTERFACES_OF_HID_MOUSE 0
@@ -121,7 +121,7 @@ typedef struct
USB_Descriptor_InterfaceAssociation_t CDC_IAD;
#endif
-#ifdef CFG_CLASS_CDC
+#ifdef TUSB_CFG_DEVICE_CDC
//CDC - Serial
//CDC Control Interface
USB_INTERFACE_DESCRIPTOR CDC_CCI_Interface;
@@ -136,14 +136,14 @@ typedef struct
USB_ENDPOINT_DESCRIPTOR CDC_DataInEndpoint;
#endif
-#ifdef CFG_CLASS_HID_KEYBOARD
+#ifdef TUSB_CFG_DEVICE_HID_KEYBOARD
//Keyboard HID Interface
USB_INTERFACE_DESCRIPTOR HID_KeyboardInterface;
HID_DESCRIPTOR HID_KeyboardHID;
USB_ENDPOINT_DESCRIPTOR HID_KeyboardEndpoint;
#endif
-#ifdef CFG_CLASS_HID_MOUSE
+#ifdef TUSB_CFG_DEVICE_HID_MOUSE
//Mouse HID Interface
USB_INTERFACE_DESCRIPTOR HID_MouseInterface;
HID_DESCRIPTOR HID_MouseHID;
diff --git a/demos/device/keyboard/main.c b/demos/device/keyboard/main.c
index ba12f1aa3..b031312e4 100644
--- a/demos/device/keyboard/main.c
+++ b/demos/device/keyboard/main.c
@@ -28,22 +28,22 @@ int main(void)
printf("hello world\n");
- #ifndef CFG_CLASS_CDC
+ #ifndef TUSB_CFG_DEVICE_CDC
if (usb_isConfigured())
{
- #ifdef CFG_CLASS_HID_KEYBOARD
+ #ifdef TUSB_CFG_DEVICE_HID_KEYBOARD
uint8_t keys[6] = {HID_USAGE_KEYBOARD_aA};
tusb_hid_keyboard_sendKeys(0x00, keys, 1);
#endif
- #ifdef CFG_CLASS_HID_MOUSE
+ #ifdef TUSB_CFG_DEVICE_HID_MOUSE
tusb_hid_mouse_send(0, 10, 10);
#endif
}
#endif
}
- #ifdef CFG_CLASS_CDC
+ #ifdef TUSB_CFG_DEVICE_CDC
if (usb_isConfigured())
{
uint8_t cdc_char;
@@ -51,7 +51,7 @@ int main(void)
{
switch (cdc_char)
{
- #ifdef CFG_CLASS_HID_KEYBOARD
+ #ifdef TUSB_CFG_DEVICE_HID_KEYBOARD
case '1' :
{
uint8_t keys[6] = {HID_USAGE_KEYBOARD_aA + 'e' - 'a'};
@@ -60,7 +60,7 @@ int main(void)
break;
#endif
- #ifdef CFG_CLASS_HID_MOUSE
+ #ifdef TUSB_CFG_DEVICE_HID_MOUSE
case '2' :
tusb_hid_mouse_send(0, 10, 10);
break;