diff options
| author | hathach <[email protected]> | 2018-04-10 14:31:11 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-04-10 14:31:11 +0700 |
| commit | 3c2467196070eeedd4171e183db04fb815677246 (patch) | |
| tree | 742e3f277776b025ee0f90ab63ef2f70a3b3d03a /examples/obsolete/host/src | |
| parent | 3473c71a6a7cb22cb45f368dba4edda49ed8f7af (diff) | |
mass rename TUSB_CFG to CFG_TUSB
Diffstat (limited to 'examples/obsolete/host/src')
| -rw-r--r-- | examples/obsolete/host/src/app_os_prio.h | 8 | ||||
| -rw-r--r-- | examples/obsolete/host/src/cdc_serial_host_app.c | 10 | ||||
| -rw-r--r-- | examples/obsolete/host/src/cdc_serial_host_app.h | 2 | ||||
| -rw-r--r-- | examples/obsolete/host/src/keyboard_host_app.c | 4 | ||||
| -rw-r--r-- | examples/obsolete/host/src/keyboard_host_app.h | 2 | ||||
| -rw-r--r-- | examples/obsolete/host/src/main.c | 22 | ||||
| -rw-r--r-- | examples/obsolete/host/src/mouse_host_app.c | 4 | ||||
| -rw-r--r-- | examples/obsolete/host/src/mouse_host_app.h | 2 | ||||
| -rw-r--r-- | examples/obsolete/host/src/msc_cli.c | 4 | ||||
| -rw-r--r-- | examples/obsolete/host/src/msc_host_app.c | 8 | ||||
| -rw-r--r-- | examples/obsolete/host/src/msc_host_app.h | 2 | ||||
| -rw-r--r-- | examples/obsolete/host/src/rndis_host_app.c | 2 | ||||
| -rw-r--r-- | examples/obsolete/host/src/rndis_host_app.h | 2 | ||||
| -rw-r--r-- | examples/obsolete/host/src/tusb_config.h | 48 |
14 files changed, 60 insertions, 60 deletions
diff --git a/examples/obsolete/host/src/app_os_prio.h b/examples/obsolete/host/src/app_os_prio.h index 99be2de0c..5eacd4c1e 100644 --- a/examples/obsolete/host/src/app_os_prio.h +++ b/examples/obsolete/host/src/app_os_prio.h @@ -53,18 +53,18 @@ #include "tusb.h" -#if TUSB_CFG_OS == TUSB_OS_NONE +#if CFG_TUSB_OS == TUSB_OS_NONE #define LOWER_PRIO(x) 0 // does not matter -#elif TUSB_CFG_OS == TUSB_OS_FREERTOS +#elif CFG_TUSB_OS == TUSB_OS_FREERTOS #define LOWER_PRIO(x) ((x)-1) // freeRTOS lower number --> lower priority -#elif TUSB_CFG_OS == TUSB_OS_CMSIS_RTX +#elif CFG_TUSB_OS == TUSB_OS_CMSIS_RTX #define LOWER_PRIO(x) ((x)-1) // CMSIS-RTOS lower number --> lower priority #else #error Priority is not configured for this RTOS #endif enum { - STANDARD_APP_TASK_PRIO = LOWER_PRIO(TUSB_CFG_OS_TASK_PRIO), // Application Task is lower than usb system task + STANDARD_APP_TASK_PRIO = LOWER_PRIO(CFG_TUSB_OS_TASK_PRIO), // Application Task is lower than usb system task LED_BLINKING_APP_TASK_PRIO = LOWER_PRIO(STANDARD_APP_TASK_PRIO), // Blinking task is lower than normal task KEYBOARD_APP_TASK_PRIO = STANDARD_APP_TASK_PRIO, diff --git a/examples/obsolete/host/src/cdc_serial_host_app.c b/examples/obsolete/host/src/cdc_serial_host_app.c index 1ab3f409b..0782d0518 100644 --- a/examples/obsolete/host/src/cdc_serial_host_app.c +++ b/examples/obsolete/host/src/cdc_serial_host_app.c @@ -39,7 +39,7 @@ #include "cdc_serial_host_app.h" #include "app_os_prio.h" -#if TUSB_CFG_HOST_CDC +#if CFG_TUSB_HOST_CDC #define QUEUE_SERIAL_DEPTH 100 @@ -49,8 +49,8 @@ static osal_semaphore_t sem_hdl; enum { SERIAL_BUFFER_SIZE = 64 }; -TUSB_CFG_ATTR_USBRAM static uint8_t serial_in_buffer[SERIAL_BUFFER_SIZE]; -TUSB_CFG_ATTR_USBRAM static uint8_t serial_out_buffer[SERIAL_BUFFER_SIZE]; +CFG_TUSB_ATTR_USBRAM static uint8_t serial_in_buffer[SERIAL_BUFFER_SIZE]; +CFG_TUSB_ATTR_USBRAM static uint8_t serial_out_buffer[SERIAL_BUFFER_SIZE]; static uint8_t received_bytes; // set by transfer complete callback @@ -126,7 +126,7 @@ void cdc_serial_host_app_task( void* param ) OSAL_TASK_BEGIN //------------- send characters got from uart terminal to the first CDC device -------------// - for(uint8_t dev_addr=1; dev_addr <= TUSB_CFG_HOST_DEVICE_MAX; dev_addr++) + for(uint8_t dev_addr=1; dev_addr <= CFG_TUSB_HOST_DEVICE_MAX; dev_addr++) { if ( tuh_cdc_serial_is_mounted(dev_addr) ) { @@ -152,7 +152,7 @@ void cdc_serial_host_app_task( void* param ) { for(uint8_t i=0; i<received_bytes; i++) putchar(serial_in_buffer[i]); - for(uint8_t dev_addr=1; dev_addr <= TUSB_CFG_HOST_DEVICE_MAX; dev_addr++) + for(uint8_t dev_addr=1; dev_addr <= CFG_TUSB_HOST_DEVICE_MAX; dev_addr++) { if ( tuh_cdc_serial_is_mounted(dev_addr) ) { diff --git a/examples/obsolete/host/src/cdc_serial_host_app.h b/examples/obsolete/host/src/cdc_serial_host_app.h index 4efc6cb8c..eef00bb55 100644 --- a/examples/obsolete/host/src/cdc_serial_host_app.h +++ b/examples/obsolete/host/src/cdc_serial_host_app.h @@ -53,7 +53,7 @@ extern "C" { #endif -#if TUSB_CFG_HOST_CDC +#if CFG_TUSB_HOST_CDC void cdc_serial_host_app_init(void); void cdc_serial_host_app_task(void* param); diff --git a/examples/obsolete/host/src/keyboard_host_app.c b/examples/obsolete/host/src/keyboard_host_app.c index b55c062ea..130df0feb 100644 --- a/examples/obsolete/host/src/keyboard_host_app.c +++ b/examples/obsolete/host/src/keyboard_host_app.c @@ -42,7 +42,7 @@ #include "keyboard_host_app.h" #include "app_os_prio.h" -#if TUSB_CFG_HOST_HID_KEYBOARD +#if CFG_TUSB_HOST_HID_KEYBOARD //--------------------------------------------------------------------+ // MACRO CONSTANT TYPEDEF @@ -53,7 +53,7 @@ // INTERNAL OBJECT & FUNCTION DECLARATION //--------------------------------------------------------------------+ static osal_queue_t queue_kbd_hdl; -TUSB_CFG_ATTR_USBRAM static hid_keyboard_report_t usb_keyboard_report; +CFG_TUSB_ATTR_USBRAM static hid_keyboard_report_t usb_keyboard_report; static inline uint8_t keycode_to_ascii(uint8_t modifier, uint8_t keycode) ATTR_CONST ATTR_ALWAYS_INLINE; static inline void process_kbd_report(hid_keyboard_report_t const * report); diff --git a/examples/obsolete/host/src/keyboard_host_app.h b/examples/obsolete/host/src/keyboard_host_app.h index 2b99373a3..ff20d75df 100644 --- a/examples/obsolete/host/src/keyboard_host_app.h +++ b/examples/obsolete/host/src/keyboard_host_app.h @@ -59,7 +59,7 @@ extern "C" { #endif -#if TUSB_CFG_HOST_HID_KEYBOARD +#if CFG_TUSB_HOST_HID_KEYBOARD void keyboard_host_app_init(void); void keyboard_host_app_task(void* param); diff --git a/examples/obsolete/host/src/main.c b/examples/obsolete/host/src/main.c index bb0dcd2b3..6f108c441 100644 --- a/examples/obsolete/host/src/main.c +++ b/examples/obsolete/host/src/main.c @@ -64,7 +64,7 @@ void print_greeting(void); // IMPLEMENTATION //--------------------------------------------------------------------+ -#if TUSB_CFG_OS == TUSB_OS_NONE +#if CFG_TUSB_OS == TUSB_OS_NONE // like a real RTOS, this function is a main loop invoking each task in application and never return void os_none_start_scheduler(void) { @@ -83,7 +83,7 @@ void os_none_start_scheduler(void) int main(void) { -#if TUSB_CFG_OS == TUSB_OS_CMSIS_RTX +#if CFG_TUSB_OS == TUSB_OS_CMSIS_RTX osKernelInitialize(); // CMSIS RTX requires kernel init before any other OS functions #endif @@ -101,11 +101,11 @@ int main(void) cdc_serial_host_app_init(); //------------- start OS scheduler (never return) -------------// -#if TUSB_CFG_OS == TUSB_OS_FREERTOS +#if CFG_TUSB_OS == TUSB_OS_FREERTOS vTaskStartScheduler(); -#elif TUSB_CFG_OS == TUSB_OS_NONE +#elif CFG_TUSB_OS == TUSB_OS_NONE os_none_start_scheduler(); -#elif TUSB_CFG_OS == TUSB_OS_CMSIS_RTX +#elif CFG_TUSB_OS == TUSB_OS_CMSIS_RTX osKernelStart(); #else #error need to start RTOS schduler @@ -134,10 +134,10 @@ void print_greeting(void) ); puts("This HOST demo is configured to support:"); - printf(" - RTOS = %s\n", rtos_name[TUSB_CFG_OS]); - if (TUSB_CFG_HOST_HUB ) puts(" - Hub (1 level only)"); - if (TUSB_CFG_HOST_HID_MOUSE ) puts(" - HID Mouse"); - if (TUSB_CFG_HOST_HID_KEYBOARD ) puts(" - HID Keyboard"); - if (TUSB_CFG_HOST_MSC ) puts(" - Mass Storage"); - if (TUSB_CFG_HOST_CDC ) puts(" - Communication Device Class"); + printf(" - RTOS = %s\n", rtos_name[CFG_TUSB_OS]); + if (CFG_TUSB_HOST_HUB ) puts(" - Hub (1 level only)"); + if (CFG_TUSB_HOST_HID_MOUSE ) puts(" - HID Mouse"); + if (CFG_TUSB_HOST_HID_KEYBOARD ) puts(" - HID Keyboard"); + if (CFG_TUSB_HOST_MSC ) puts(" - Mass Storage"); + if (CFG_TUSB_HOST_CDC ) puts(" - Communication Device Class"); } diff --git a/examples/obsolete/host/src/mouse_host_app.c b/examples/obsolete/host/src/mouse_host_app.c index 6464b5e8e..e9ee482d8 100644 --- a/examples/obsolete/host/src/mouse_host_app.c +++ b/examples/obsolete/host/src/mouse_host_app.c @@ -42,7 +42,7 @@ #include "mouse_host_app.h" #include "app_os_prio.h" -#if TUSB_CFG_HOST_HID_MOUSE +#if CFG_TUSB_HOST_HID_MOUSE //--------------------------------------------------------------------+ // MACRO CONSTANT TYPEDEF @@ -53,7 +53,7 @@ // INTERNAL OBJECT & FUNCTION DECLARATION //--------------------------------------------------------------------+ static osal_queue_t queue_mouse_hdl; -TUSB_CFG_ATTR_USBRAM static hid_mouse_report_t usb_mouse_report; +CFG_TUSB_ATTR_USBRAM static hid_mouse_report_t usb_mouse_report; static inline void process_mouse_report(hid_mouse_report_t const * p_report); diff --git a/examples/obsolete/host/src/mouse_host_app.h b/examples/obsolete/host/src/mouse_host_app.h index 967444454..c5e9977ae 100644 --- a/examples/obsolete/host/src/mouse_host_app.h +++ b/examples/obsolete/host/src/mouse_host_app.h @@ -62,7 +62,7 @@ extern "C" { #endif -#if TUSB_CFG_HOST_HID_MOUSE +#if CFG_TUSB_HOST_HID_MOUSE void mouse_host_app_init(void); void mouse_host_app_task(void* param); diff --git a/examples/obsolete/host/src/msc_cli.c b/examples/obsolete/host/src/msc_cli.c index e4cb2cb28..aeadb4933 100644 --- a/examples/obsolete/host/src/msc_cli.c +++ b/examples/obsolete/host/src/msc_cli.c @@ -37,7 +37,7 @@ #include "msc_cli.h" #include "ctype.h" -#if TUSB_CFG_HOST_MSC +#if CFG_TUSB_HOST_MSC #include "ff.h" #include "diskio.h" @@ -139,7 +139,7 @@ static cli_cmdfunc_t cli_command_tbl[] = //--------------------------------------------------------------------+ // INTERNAL OBJECT & FUNCTION DECLARATION //--------------------------------------------------------------------+ -TUSB_CFG_ATTR_USBRAM uint8_t fileread_buffer[CLI_FILE_READ_BUFFER]; +CFG_TUSB_ATTR_USBRAM uint8_t fileread_buffer[CLI_FILE_READ_BUFFER]; static char cli_buffer[CLI_MAX_BUFFER]; static char volume_label[20]; diff --git a/examples/obsolete/host/src/msc_host_app.c b/examples/obsolete/host/src/msc_host_app.c index 6faac68c3..957db2fad 100644 --- a/examples/obsolete/host/src/msc_host_app.c +++ b/examples/obsolete/host/src/msc_host_app.c @@ -42,7 +42,7 @@ #include "msc_host_app.h" #include "app_os_prio.h" -#if TUSB_CFG_HOST_MSC +#if CFG_TUSB_HOST_MSC #include "msc_cli.h" #include "ff.h" @@ -55,7 +55,7 @@ //--------------------------------------------------------------------+ // INTERNAL OBJECT & FUNCTION DECLARATION //--------------------------------------------------------------------+ -TUSB_CFG_ATTR_USBRAM static FATFS fatfs[TUSB_CFG_HOST_DEVICE_MAX]; +CFG_TUSB_ATTR_USBRAM static FATFS fatfs[CFG_TUSB_HOST_DEVICE_MAX]; //--------------------------------------------------------------------+ // tinyusb callbacks @@ -117,7 +117,7 @@ void tuh_msc_unmounted_cb(uint8_t dev_addr) if ( phy_disk == f_get_current_drive() ) { // active drive is unplugged --> change to other drive - for(uint8_t i=0; i<TUSB_CFG_HOST_DEVICE_MAX; i++) + for(uint8_t i=0; i<CFG_TUSB_HOST_DEVICE_MAX; i++) { if ( disk_is_ready(i) ) { @@ -158,7 +158,7 @@ void msc_host_app_task(void* param) is_any_disk_mounted = false; - for(uint8_t phy_disk=0; phy_disk < TUSB_CFG_HOST_DEVICE_MAX; phy_disk++) + for(uint8_t phy_disk=0; phy_disk < CFG_TUSB_HOST_DEVICE_MAX; phy_disk++) { if ( disk_is_ready(phy_disk) ) { diff --git a/examples/obsolete/host/src/msc_host_app.h b/examples/obsolete/host/src/msc_host_app.h index 25ece8816..c6e508e6c 100644 --- a/examples/obsolete/host/src/msc_host_app.h +++ b/examples/obsolete/host/src/msc_host_app.h @@ -54,7 +54,7 @@ extern "C" { #endif -#if TUSB_CFG_HOST_MSC +#if CFG_TUSB_HOST_MSC void msc_host_app_init(void); void msc_host_app_task(void* param); diff --git a/examples/obsolete/host/src/rndis_host_app.c b/examples/obsolete/host/src/rndis_host_app.c index e6b37e4d3..5bb60182c 100644 --- a/examples/obsolete/host/src/rndis_host_app.c +++ b/examples/obsolete/host/src/rndis_host_app.c @@ -39,7 +39,7 @@ #include "rndis_host_app.h" #include "app_os_prio.h" -#if TUSB_CFG_HOST_CDC && TUSB_CFG_HOST_CDC_RNDIS +#if CFG_TUSB_HOST_CDC && CFG_TUSB_HOST_CDC_RNDIS //--------------------------------------------------------------------+ // MACRO CONSTANT TYPEDEF diff --git a/examples/obsolete/host/src/rndis_host_app.h b/examples/obsolete/host/src/rndis_host_app.h index e4fcacf46..9fa19351e 100644 --- a/examples/obsolete/host/src/rndis_host_app.h +++ b/examples/obsolete/host/src/rndis_host_app.h @@ -53,7 +53,7 @@ extern "C" { #endif -#if TUSB_CFG_HOST_CDC && TUSB_CFG_HOST_CDC_RNDIS +#if CFG_TUSB_HOST_CDC && CFG_TUSB_HOST_CDC_RNDIS void rndis_host_app_init(void); void rndis_host_app_task(void* param); diff --git a/examples/obsolete/host/src/tusb_config.h b/examples/obsolete/host/src/tusb_config.h index be1d5c7ed..501f6304d 100644 --- a/examples/obsolete/host/src/tusb_config.h +++ b/examples/obsolete/host/src/tusb_config.h @@ -46,57 +46,57 @@ //--------------------------------------------------------------------+ // CONTROLLER CONFIGURATION //--------------------------------------------------------------------+ -//#define TUSB_CFG_MCU will be passed from IDE for easy board/mcu switching -#define TUSB_CFG_CONTROLLER_0_MODE (TUSB_MODE_HOST) +//#define CFG_TUSB_MCU will be passed from IDE for easy board/mcu switching +#define CFG_TUSB_CONTROLLER_0_MODE (TUSB_MODE_HOST) //--------------------------------------------------------------------+ // HOST CONFIGURATION //--------------------------------------------------------------------+ //------------- CLASS -------------// -#define TUSB_CFG_HOST_HUB 1 -#define TUSB_CFG_HOST_HID_KEYBOARD 1 -#define TUSB_CFG_HOST_HID_MOUSE 1 -#define TUSB_CFG_HOST_HID_GENERIC 0 // (not yet supported) -#define TUSB_CFG_HOST_MSC 1 -#define TUSB_CFG_HOST_CDC 1 +#define CFG_TUSB_HOST_HUB 1 +#define CFG_TUSB_HOST_HID_KEYBOARD 1 +#define CFG_TUSB_HOST_HID_MOUSE 1 +#define CFG_TUSB_HOST_HID_GENERIC 0 // (not yet supported) +#define CFG_TUSB_HOST_MSC 1 +#define CFG_TUSB_HOST_CDC 1 -#define TUSB_CFG_HOST_DEVICE_MAX (TUSB_CFG_HOST_HUB ? 5 : 1) // normal hub has 4 ports +#define CFG_TUSB_HOST_DEVICE_MAX (CFG_TUSB_HOST_HUB ? 5 : 1) // normal hub has 4 ports //--------------------------------------------------------------------+ // COMMON CONFIGURATION //--------------------------------------------------------------------+ -#define TUSB_CFG_DEBUG 2 +#define CFG_TUSB_DEBUG 2 -//#define TUSB_CFG_OS TUSB_OS_NONE // defined using eclipse build -//#define TUSB_CFG_OS_TASK_PRIO 0 // defined using eclipse build +//#define CFG_TUSB_OS TUSB_OS_NONE // defined using eclipse build +//#define CFG_TUSB_OS_TASK_PRIO 0 // defined using eclipse build //--------------------------------------------------------------------+ // USB RAM PLACEMENT //--------------------------------------------------------------------+ #ifdef __CODE_RED // make use of code red's support for ram region macros - #if 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 ATTR_SECTION(.data.$RAM3) + #if 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 ATTR_SECTION(.data.$RAM3) #endif #elif defined __CC_ARM // Compiled with Keil armcc - #if (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_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_LPC175X_6X) + #if (CFG_TUSB_MCU == MCU_LPC175X_6X) // LP175x_6x can access all but CMSIS-RTX causes overflow in 32KB SRAM --> move to AHB ram - #define TUSB_CFG_ATTR_USBRAM _Pragma("location=\".sram\"") - #elif (TUSB_CFG_MCU == MCU_LPC43XX) - #define TUSB_CFG_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"") + #define CFG_TUSB_ATTR_USBRAM _Pragma("location=\".sram\"") + #elif (CFG_TUSB_MCU == MCU_LPC43XX) + #define CFG_TUSB_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"") #endif #else |
