mass rename TUSB_CFG to CFG_TUSB

This commit is contained in:
hathach
2018-04-10 14:31:11 +07:00
parent 3473c71a6a
commit 3c24671960
138 changed files with 628 additions and 626 deletions

View File

@@ -144,9 +144,9 @@ void print_greeting(void)
printf("--------------------------------------------------------------------\n\n");
printf("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");
}

View File

@@ -38,7 +38,7 @@
#include "msc_device_app.h"
#if TUSB_CFG_DEVICE_MSC
#if CFG_TUSB_DEVICE_MSC
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+

View File

@@ -50,7 +50,7 @@
extern "C" {
#endif
#if TUSB_CFG_DEVICE_MSC
#if CFG_TUSB_DEVICE_MSC
enum
{
@@ -63,7 +63,7 @@ enum
If you find any bugs or get any questions, feel free to file an\r\n\
issue at github.com/hathach/tinyusb"
#if TUSB_CFG_MCU==MCU_LPC11UXX || TUSB_CFG_MCU==MCU_LPC13UXX
#if CFG_TUSB_MCU==MCU_LPC11UXX || CFG_TUSB_MCU==MCU_LPC13UXX
#define MSCD_APP_ROMDISK
#else // defaults is ram disk
#define MSCD_APP_RAMDISK

View File

@@ -38,7 +38,7 @@
#include "msc_device_app.h"
#if TUSB_CFG_DEVICE_MSC && defined (MSCD_APP_RAMDISK)
#if CFG_TUSB_DEVICE_MSC && defined (MSCD_APP_RAMDISK)
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
@@ -47,7 +47,7 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
CFG_TUSB_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
uint8_t msc_device_ramdisk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
{
//------------- Boot Sector -------------//

View File

@@ -46,41 +46,41 @@
//--------------------------------------------------------------------+
// 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 1
#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 1
#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
//--------------------------------------------------------------------+
#define TUSB_CFG_ATTR_USBRAM
#define CFG_TUSB_ATTR_USBRAM
// LPC11uxx and LPC13uxx requires each buffer has to be 64-byte alignment
#if TUSB_CFG_MCU == MCU_LPC11UXX || TUSB_CFG_MCU == MCU_LPC13UXX
#if CFG_TUSB_MCU == MCU_LPC11UXX || CFG_TUSB_MCU == MCU_LPC13UXX
#define ATTR_USB_MIN_ALIGNMENT ATTR_ALIGNED(64)
#elif defined NRF52840_XXAA
#define ATTR_USB_MIN_ALIGNMENT ATTR_ALIGNED(4)

View File

@@ -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,

View File

@@ -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) ) )