summaryrefslogtreecommitdiff
path: root/examples/device/device_virtual_com/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/device/device_virtual_com/src')
-rw-r--r--examples/device/device_virtual_com/src/main.c10
-rw-r--r--examples/device/device_virtual_com/src/tusb_config.h66
-rw-r--r--examples/device/device_virtual_com/src/tusb_descriptors.c2
-rw-r--r--examples/device/device_virtual_com/src/tusb_descriptors.h2
4 files changed, 40 insertions, 40 deletions
diff --git a/examples/device/device_virtual_com/src/main.c b/examples/device/device_virtual_com/src/main.c
index 3ee3a74d3..8d4065194 100644
--- a/examples/device/device_virtual_com/src/main.c
+++ b/examples/device/device_virtual_com/src/main.c
@@ -146,9 +146,9 @@ void print_greeting(void)
);
puts("This DEVICE demo is configured to support:");
- printf(" - RTOS = %s\n", rtos_name[TUSB_CFG_OS]);
- if (TUSB_CFG_DEVICE_HID_MOUSE ) puts(" - HID Mouse");
- if (TUSB_CFG_DEVICE_HID_KEYBOARD ) puts(" - HID Keyboard");
- if (TUSB_CFG_DEVICE_MSC ) puts(" - Mass Storage");
- if (TUSB_CFG_DEVICE_CDC ) puts(" - Communication Device Class");
+ printf(" - RTOS = %s\n", rtos_name[CFG_TUSB_OS]);
+ if (CFG_TUSB_DEVICE_HID_MOUSE ) puts(" - HID Mouse");
+ if (CFG_TUSB_DEVICE_HID_KEYBOARD ) puts(" - HID Keyboard");
+ if (CFG_TUSB_DEVICE_MSC ) puts(" - Mass Storage");
+ if (CFG_TUSB_DEVICE_CDC ) puts(" - Communication Device Class");
}
diff --git a/examples/device/device_virtual_com/src/tusb_config.h b/examples/device/device_virtual_com/src/tusb_config.h
index be2aaf71a..d0737de13 100644
--- a/examples/device/device_virtual_com/src/tusb_config.h
+++ b/examples/device/device_virtual_com/src/tusb_config.h
@@ -46,70 +46,70 @@
//--------------------------------------------------------------------+
// CONTROLLER CONFIGURATION
//--------------------------------------------------------------------+
-//#define TUSB_CFG_MCU will be passed from IDE/command line for easy board/mcu switching
+//#define CFG_TUSB_MCU will be passed from IDE/command line for easy board/mcu switching
-#define TUSB_CFG_CONTROLLER_0_MODE (TUSB_MODE_DEVICE)
-//#define TUSB_CFG_CONTROLLER_1_MODE (TUSB_MODE_DEVICE)
+#define CFG_TUSB_CONTROLLER_0_MODE (TUSB_MODE_DEVICE)
+//#define CFG_TUSB_CONTROLLER_1_MODE (TUSB_MODE_DEVICE)
//--------------------------------------------------------------------+
// DEVICE CONFIGURATION
//--------------------------------------------------------------------+
-#define TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE 64
+#define CFG_TUSB_DEVICE_CONTROL_ENDOINT_SIZE 64
//------------- CLASS -------------//
-#define TUSB_CFG_DEVICE_HID_KEYBOARD 0
-#define TUSB_CFG_DEVICE_HID_MOUSE 0
-#define TUSB_CFG_DEVICE_HID_GENERIC 0 // not supported yet
-#define TUSB_CFG_DEVICE_MSC 0
-#define TUSB_CFG_DEVICE_CDC 1
+#define CFG_TUSB_DEVICE_HID_KEYBOARD 0
+#define CFG_TUSB_DEVICE_HID_MOUSE 0
+#define CFG_TUSB_DEVICE_HID_GENERIC 0 // not supported yet
+#define CFG_TUSB_DEVICE_MSC 0
+#define CFG_TUSB_DEVICE_CDC 1
//--------------------------------------------------------------------+
// COMMON CONFIGURATION
//--------------------------------------------------------------------+
-#define TUSB_CFG_DEBUG 2
+#define CFG_TUSB_DEBUG 2
-//#define TUSB_CFG_OS TUSB_OS_NONE // be passed from IDE/command line for easy project switching
-//#define TUSB_CFG_OS_TASK_PRIO 0 // be passed from IDE/command line for easy project switching
-#define TUSB_CFG_TICKS_HZ 1000
+//#define CFG_TUSB_OS TUSB_OS_NONE // be passed from IDE/command line for easy project switching
+//#define CFG_TUSB_OS_TASK_PRIO 0 // be passed from IDE/command line for easy project switching
+#define CFG_TUSB_TICKS_HZ 1000
-//#define TUSB_CFG_OS TUSB_OS_NONE
+//#define CFG_TUSB_OS TUSB_OS_NONE
//--------------------------------------------------------------------+
// USB RAM PLACEMENT
//--------------------------------------------------------------------+
#ifdef __CODE_RED // compiled with lpcxpresso
- #if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
- #define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(.data.$RAM2) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
- #elif TUSB_CFG_MCU == MCU_LPC175X_6X
- #define TUSB_CFG_ATTR_USBRAM // LPC17xx USB DMA can access all
- #elif (TUSB_CFG_MCU == MCU_LPC43XX)
- #define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(.data.$RAM3)
+ #if (CFG_TUSB_MCU == MCU_LPC11UXX) || (CFG_TUSB_MCU == MCU_LPC13UXX)
+ #define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(.data.$RAM2) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
+ #elif CFG_TUSB_MCU == MCU_LPC175X_6X
+ #define CFG_TUSB_ATTR_USBRAM // LPC17xx USB DMA can access all
+ #elif (CFG_TUSB_MCU == MCU_LPC43XX)
+ #define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(.data.$RAM3)
#endif
#elif defined __CC_ARM // Compiled with Keil armcc, USBRAM_SECTION is defined in scatter files
- #if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
- #define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(USBRAM_SECTION) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
- #elif (TUSB_CFG_MCU == MCU_LPC175X_6X)
- #define TUSB_CFG_ATTR_USBRAM // LPC17xx USB DMA can access all address
- #elif (TUSB_CFG_MCU == MCU_LPC43XX)
- #define TUSB_CFG_ATTR_USBRAM // Use keil tool configure to have AHB SRAM as default memory
+ #if (CFG_TUSB_MCU == MCU_LPC11UXX) || (CFG_TUSB_MCU == MCU_LPC13UXX)
+ #define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(USBRAM_SECTION) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
+ #elif (CFG_TUSB_MCU == MCU_LPC175X_6X)
+ #define CFG_TUSB_ATTR_USBRAM // LPC17xx USB DMA can access all address
+ #elif (CFG_TUSB_MCU == MCU_LPC43XX)
+ #define CFG_TUSB_ATTR_USBRAM // Use keil tool configure to have AHB SRAM as default memory
#endif
#elif defined __ICCARM__ // compiled with IAR
- #if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
- #define TUSB_CFG_ATTR_USBRAM _Pragma("location=\"USB_PACKET_MEMORY\"") ATTR_ALIGNED(64)
- #elif (TUSB_CFG_MCU == MCU_LPC175X_6X)
- #define TUSB_CFG_ATTR_USBRAM
- #elif (TUSB_CFG_MCU == MCU_LPC43XX)
- #define TUSB_CFG_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"")
+ #if (CFG_TUSB_MCU == MCU_LPC11UXX) || (CFG_TUSB_MCU == MCU_LPC13UXX)
+ #define CFG_TUSB_ATTR_USBRAM _Pragma("location=\"USB_PACKET_MEMORY\"") ATTR_ALIGNED(64)
+ #elif (CFG_TUSB_MCU == MCU_LPC175X_6X)
+ #define CFG_TUSB_ATTR_USBRAM
+ #elif (CFG_TUSB_MCU == MCU_LPC43XX)
+ #define CFG_TUSB_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"")
#endif
#elif defined __SES_ARM
-#define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(.bss2)
+#define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(.bss2)
#else
diff --git a/examples/device/device_virtual_com/src/tusb_descriptors.c b/examples/device/device_virtual_com/src/tusb_descriptors.c
index 74954ba1c..f0867585a 100644
--- a/examples/device/device_virtual_com/src/tusb_descriptors.c
+++ b/examples/device/device_virtual_com/src/tusb_descriptors.c
@@ -53,7 +53,7 @@ tusb_desc_device_t const desc_device =
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
.bDeviceProtocol = MISC_PROTOCOL_IAD,
- .bMaxPacketSize0 = TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE,
+ .bMaxPacketSize0 = CFG_TUSB_DEVICE_CONTROL_ENDOINT_SIZE,
.idVendor = CFG_VENDORID,
.idProduct = CFG_PRODUCTID,
diff --git a/examples/device/device_virtual_com/src/tusb_descriptors.h b/examples/device/device_virtual_com/src/tusb_descriptors.h
index af200946c..2d362bc0b 100644
--- a/examples/device/device_virtual_com/src/tusb_descriptors.h
+++ b/examples/device/device_virtual_com/src/tusb_descriptors.h
@@ -50,7 +50,7 @@
// each combination of interfaces need to have a unique productid, as windows will bind & remember device driver after the first plug.
// Auto ProductID layout's Bitmap: (MSB) MassStorage | Generic | Mouse | Key | CDC (LSB)
#ifndef CFG_PRODUCTID
- #define PRODUCTID_BITMAP(interface, n) ( (TUSB_CFG_DEVICE_##interface) << (n) )
+ #define PRODUCTID_BITMAP(interface, n) ( (CFG_TUSB_DEVICE_##interface) << (n) )
#define CFG_PRODUCTID (0x4000 | ( PRODUCTID_BITMAP(CDC, 0) | PRODUCTID_BITMAP(HID_KEYBOARD, 1) | \
PRODUCTID_BITMAP(HID_MOUSE, 2) | PRODUCTID_BITMAP(HID_GENERIC, 3) | \
PRODUCTID_BITMAP(MSC, 4) ) )