summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-04-10 14:31:11 +0700
committerhathach <[email protected]>2018-04-10 14:31:11 +0700
commit3c2467196070eeedd4171e183db04fb815677246 (patch)
tree742e3f277776b025ee0f90ab63ef2f70a3b3d03a
parent3473c71a6a7cb22cb45f368dba4edda49ed8f7af (diff)
mass rename TUSB_CFG to CFG_TUSB
-rw-r--r--doxygen/configuration.txt48
-rw-r--r--doxygen/getting_started.md2
-rw-r--r--doxygen/started_demo.md2
-rw-r--r--examples/device/device_virtual_com/segger/device_virtual_com.emProject2
-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
-rw-r--r--examples/device/device_virtual_com/xpresso/.cproject2
-rw-r--r--examples/device/nrf52840/src/main.c10
-rw-r--r--examples/device/nrf52840/src/msc_device_app.c2
-rw-r--r--examples/device/nrf52840/src/msc_device_app.h4
-rw-r--r--examples/device/nrf52840/src/msc_device_ramdisk.c4
-rw-r--r--examples/device/nrf52840/src/tusb_config.h32
-rw-r--r--examples/device/nrf52840/src/tusb_descriptors.c2
-rw-r--r--examples/device/nrf52840/src/tusb_descriptors.h2
-rw-r--r--examples/obsolete/device/device_freertos/.cproject36
-rw-r--r--examples/obsolete/device/device_os_none/.cproject24
-rw-r--r--examples/obsolete/device/src/app_os_prio.h6
-rw-r--r--examples/obsolete/device/src/cdc_device_app.c2
-rw-r--r--examples/obsolete/device/src/cdc_device_app.h2
-rw-r--r--examples/obsolete/device/src/keyboard_device_app.c4
-rw-r--r--examples/obsolete/device/src/keyboard_device_app.h2
-rw-r--r--examples/obsolete/device/src/main.c16
-rw-r--r--examples/obsolete/device/src/mouse_device_app.c4
-rw-r--r--examples/obsolete/device/src/mouse_device_app.h2
-rw-r--r--examples/obsolete/device/src/msc_device_app.c2
-rw-r--r--examples/obsolete/device/src/msc_device_app.h4
-rw-r--r--examples/obsolete/device/src/msc_device_ramdisk.c4
-rw-r--r--examples/obsolete/device/src/msc_device_romdisk.c4
-rw-r--r--examples/obsolete/device/src/tusb_config.h62
-rw-r--r--examples/obsolete/device/src/tusb_descriptors.c20
-rw-r--r--examples/obsolete/device/src/tusb_descriptors.h28
-rw-r--r--examples/obsolete/host/host_freertos/.cproject28
-rw-r--r--examples/obsolete/host/host_os_none/.cproject16
-rw-r--r--examples/obsolete/host/src/app_os_prio.h8
-rw-r--r--examples/obsolete/host/src/cdc_serial_host_app.c10
-rw-r--r--examples/obsolete/host/src/cdc_serial_host_app.h2
-rw-r--r--examples/obsolete/host/src/keyboard_host_app.c4
-rw-r--r--examples/obsolete/host/src/keyboard_host_app.h2
-rw-r--r--examples/obsolete/host/src/main.c22
-rw-r--r--examples/obsolete/host/src/mouse_host_app.c4
-rw-r--r--examples/obsolete/host/src/mouse_host_app.h2
-rw-r--r--examples/obsolete/host/src/msc_cli.c4
-rw-r--r--examples/obsolete/host/src/msc_host_app.c8
-rw-r--r--examples/obsolete/host/src/msc_host_app.h2
-rw-r--r--examples/obsolete/host/src/rndis_host_app.c2
-rw-r--r--examples/obsolete/host/src/rndis_host_app.h2
-rw-r--r--examples/obsolete/host/src/tusb_config.h48
-rw-r--r--examples/readme.md2
-rw-r--r--hw/bsp/ea4357/board_ea4357.c6
-rw-r--r--hw/bsp/keil/board_mcb4300.c2
-rw-r--r--hw/bsp/lpcxpresso/board_lpclink2.c2
-rw-r--r--hw/bsp/lpcxpresso/board_lpcxpresso11u14.c2
-rw-r--r--hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c2
-rw-r--r--hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c2
-rw-r--r--hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c2
-rw-r--r--hw/bsp/ngx/board_ngx4330.c2
-rw-r--r--hw/mcu/nxp/lpc11uxx/hal_mcu/hal_lpc11uxx.c2
-rw-r--r--hw/mcu/nxp/lpc13uxx/hal_mcu/hal_lpc13uxx.c2
-rw-r--r--readme.markdown2
-rw-r--r--tests/.cproject2
-rw-r--r--tests/lpc175x_6x/project.yml2
-rw-r--r--tests/lpc175x_6x/test/test_usbd.c12
-rw-r--r--tests/lpc18xx_43xx/project.yml2
-rw-r--r--tests/lpc18xx_43xx/test/host/cdc/descriptor_cdc.c4
-rw-r--r--tests/lpc18xx_43xx/test/host/cdc/test_cdc_host.c6
-rw-r--r--tests/lpc18xx_43xx/test/host/cdc/test_cdc_rndis_host.c6
-rw-r--r--tests/lpc18xx_43xx/test/host/ehci/test_ehci_init.c2
-rw-r--r--tests/lpc18xx_43xx/test/host/ehci/test_ehci_isr.c2
-rw-r--r--tests/lpc18xx_43xx/test/host/ehci/test_ehci_structure.c2
-rw-r--r--tests/lpc18xx_43xx/test/host/ehci/test_pipe_bulk_open.c4
-rw-r--r--tests/lpc18xx_43xx/test/host/ehci/test_pipe_bulk_xfer.c4
-rw-r--r--tests/lpc18xx_43xx/test/host/ehci/test_pipe_control_open.c4
-rw-r--r--tests/lpc18xx_43xx/test/host/ehci/test_pipe_control_xfer.c4
-rw-r--r--tests/lpc18xx_43xx/test/host/ehci/test_pipe_interrupt_open.c4
-rw-r--r--tests/lpc18xx_43xx/test/host/ehci/test_pipe_interrupt_xfer.c4
-rw-r--r--tests/lpc18xx_43xx/test/host/ehci/test_pipe_isochronous_open.c4
-rw-r--r--tests/lpc18xx_43xx/test/host/hid/test_hid_host.c4
-rw-r--r--tests/lpc18xx_43xx/test/host/hid/test_hidh_generic.c6
-rw-r--r--tests/lpc18xx_43xx/test/host/hid/test_hidh_keyboard.c6
-rw-r--r--tests/lpc18xx_43xx/test/host/hid/test_hidh_mouse.c6
-rw-r--r--tests/lpc18xx_43xx/test/host/host_helper.h4
-rw-r--r--tests/lpc18xx_43xx/test/host/integration/test_hidh_keyboard_integrate.c2
-rw-r--r--tests/lpc18xx_43xx/test/host/msc/test_msc_host.c6
-rw-r--r--tests/lpc18xx_43xx/test/host/usbh/test_enum_task.c8
-rw-r--r--tests/lpc18xx_43xx/test/host/usbh/test_usbh.c6
-rw-r--r--tests/lpc18xx_43xx/test/test_osal_none.c18
-rw-r--r--tests/support/descriptor_test.c8
-rw-r--r--tests/support/descriptor_test.h2
-rw-r--r--tests/support/ehci_controller_fake.c2
-rw-r--r--tests/support/tusb_config.h42
-rw-r--r--tinyusb.Doxyfile10
-rw-r--r--tinyusb/class/cdc/cdc_device.c8
-rw-r--r--tinyusb/class/cdc/cdc_host.c6
-rw-r--r--tinyusb/class/cdc/cdc_host.h10
-rw-r--r--tinyusb/class/cdc/cdc_rndis_host.c14
-rw-r--r--tinyusb/class/custom_class_host.c6
-rw-r--r--tinyusb/class/hid/hid_device.c10
-rw-r--r--tinyusb/class/hid/hid_device.h8
-rw-r--r--tinyusb/class/hid/hid_host.c40
-rw-r--r--tinyusb/class/hid/hid_host.h4
-rw-r--r--tinyusb/class/msc/msc_device.c6
-rw-r--r--tinyusb/class/msc/msc_device.h4
-rw-r--r--tinyusb/class/msc/msc_host.c8
-rw-r--r--tinyusb/class/msc/msc_host.h6
-rw-r--r--tinyusb/common/tusb_compiler.h2
-rw-r--r--tinyusb/common/tusb_error.h4
-rw-r--r--tinyusb/common/tusb_fifo.h2
-rw-r--r--tinyusb/common/tusb_verify.h2
-rw-r--r--tinyusb/device/usbd.c18
-rw-r--r--tinyusb/device/usbd.h4
-rw-r--r--tinyusb/host/ehci/ehci.c32
-rw-r--r--tinyusb/host/ehci/ehci.h2
-rw-r--r--tinyusb/host/hcd.h4
-rw-r--r--tinyusb/host/hub.c8
-rw-r--r--tinyusb/host/ohci/ohci.c8
-rw-r--r--tinyusb/host/ohci/ohci.h4
-rw-r--r--tinyusb/host/usbh.c38
-rw-r--r--tinyusb/host/usbh_hcd.h2
-rw-r--r--tinyusb/osal/osal.c2
-rw-r--r--tinyusb/osal/osal.h8
-rw-r--r--tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c2
-rw-r--r--tinyusb/portable/nxp/lpc11xx_lpc13xx/dcd_lpc_11uxx_13uxx.c10
-rw-r--r--tinyusb/portable/nxp/lpc17xx/dcd_lpc175x_6x.c10
-rw-r--r--tinyusb/portable/nxp/lpc17xx/hal_lpc175x_6x.c2
-rw-r--r--tinyusb/portable/nxp/lpc43xx_lpc18xx/dcd_lpc43xx.c12
-rw-r--r--tinyusb/portable/nxp/lpc43xx_lpc18xx/hal_lpc43xx.c18
-rw-r--r--tinyusb/tusb.c4
-rw-r--r--tinyusb/tusb.h14
-rw-r--r--tinyusb/tusb_hal.h8
-rw-r--r--tinyusb/tusb_option.h76
-rw-r--r--vendor/fatfs/ccsbcs.c4
-rw-r--r--vendor/fatfs/diskio.c10
-rw-r--r--vendor/fatfs/diskio.h2
-rw-r--r--vendor/fatfs/ff.c4
-rw-r--r--vendor/fatfs/ffconf.h2
-rw-r--r--vendor/freertos/FreeRTOSConfig.h2
138 files changed, 628 insertions, 626 deletions
diff --git a/doxygen/configuration.txt b/doxygen/configuration.txt
index c84eea76e..8f5887718 100644
--- a/doxygen/configuration.txt
+++ b/doxygen/configuration.txt
@@ -7,46 +7,46 @@
/// \brief tell the stack which mode (host/device/otg) the usb controller0 will be operated on. Possible value is
/// from \ref group_mode. Note the hardware usb controller must support the selected mode.
-#define TUSB_CFG_CONTROLLER_0_MODE
+#define CFG_TUSB_CONTROLLER_0_MODE
/** USB controller in MCU often has limited access to specific RAM section. The Stack will use this macro to place internal variables
- into the USB RAM section as follows. if your mcu's usb controller has no such limit, define TUSB_CFG_ATTR_USBRAM as empty macro.
+ into the USB RAM section as follows. if your mcu's usb controller has no such limit, define CFG_TUSB_ATTR_USBRAM as empty macro.
@code
- TUSB_CFG_ATTR_USBRAM uint8_t usb_xfer_buffer[10];
+ CFG_TUSB_ATTR_USBRAM uint8_t usb_xfer_buffer[10];
@endcode
*/
-#define TUSB_CFG_ATTR_USBRAM
+#define CFG_TUSB_ATTR_USBRAM
-#define TUSB_CFG_MCU ///< Select one of the supported MCU, the value must be from \ref group_mcu
-#define TUSB_CFG_OS ///< Select one of the supported RTOS, the value must be from \ref group_supported_os.
-#define TUSB_CFG_OS_TASK_PRIO ///< If \ref TUSB_CFG_OS is configured to use a real RTOS (other than TUSB_OS_NONE). This determines the priority of the usb stack task.
-#define TUSB_CFG_TICKS_HZ ///< The rate ticks in hert. This is used in conjunction with \ref tusb_tick_get to calculate timing.
+#define CFG_TUSB_MCU ///< Select one of the supported MCU, the value must be from \ref group_mcu
+#define CFG_TUSB_OS ///< Select one of the supported RTOS, the value must be from \ref group_supported_os.
+#define CFG_TUSB_OS_TASK_PRIO ///< If \ref CFG_TUSB_OS is configured to use a real RTOS (other than TUSB_OS_NONE). This determines the priority of the usb stack task.
+#define CFG_TUSB_TICKS_HZ ///< The rate ticks in hert. This is used in conjunction with \ref tusb_tick_get to calculate timing.
//--------------------------------------------------------------------+
// HOST CONFIGURATION
//--------------------------------------------------------------------+
-/** \defgroup TUSB_CFG_HOST Host Options
+/** \defgroup CFG_TUSB_HOST Host Options
* @{ */
/** \brief Maximum number of device host stack can manage
* \n If hub class is not enabled, set this equal to number of controllers in host mode
* \n If hub class is enabled, make sure hub is also counted */
-#define TUSB_CFG_HOST_DEVICE_MAX
+#define CFG_TUSB_HOST_DEVICE_MAX
/// \brief Buffer size used for getting device configuration descriptor. You may want to increase this from default (256)
/// to support lengthy composite device especially with Audio or Video class
-#define TUSB_CFG_HOST_ENUM_BUFFER_SIZE
+#define CFG_TUSB_HOST_ENUM_BUFFER_SIZE
/** \defgroup config_host_class Class Driver
* \brief For each Class Driver a value of 1 means enable, value of 0 mean disable
* @{ */
-#define TUSB_CFG_HOST_HUB ///< Enable Hub Class
-#define TUSB_CFG_HOST_HID_KEYBOARD ///< Enable HID Class for Keyboard
-#define TUSB_CFG_HOST_HID_MOUSE ///< Enable HID Class for Mouse
-#define TUSB_CFG_HOST_HID_GENERIC ///< Enable HID Class for Generic (not supported yet)
-#define TUSB_CFG_HOST_MSC ///< Enable Mass Storage Class (SCSI subclass only)
-#define TUSB_CFG_HOST_CDC ///< Enable Virtual Serial (Communication Device Class)
+#define CFG_TUSB_HOST_HUB ///< Enable Hub Class
+#define CFG_TUSB_HOST_HID_KEYBOARD ///< Enable HID Class for Keyboard
+#define CFG_TUSB_HOST_HID_MOUSE ///< Enable HID Class for Mouse
+#define CFG_TUSB_HOST_HID_GENERIC ///< Enable HID Class for Generic (not supported yet)
+#define CFG_TUSB_HOST_MSC ///< Enable Mass Storage Class (SCSI subclass only)
+#define CFG_TUSB_HOST_CDC ///< Enable Virtual Serial (Communication Device Class)
/** @} */
/** @} */ // group Host
@@ -54,10 +54,10 @@
//--------------------------------------------------------------------+
// DEVICE CONFIGURATION
//--------------------------------------------------------------------+
-/** \defgroup TUSB_CFG_DEVICE Device Options
+/** \defgroup CFG_TUSB_DEVICE Device Options
* @{ */
-#define TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE ///< Max packet size of Cotnrol Endpoint, default is 64
+#define CFG_TUSB_DEVICE_CONTROL_ENDOINT_SIZE ///< Max packet size of Cotnrol Endpoint, default is 64
/// Application MUST define this variable and initialize its pointers's member to all required USB descriptors including
/// Device Descriptor, Configuration Descriptor, String Descriptors, HID Report Descriptors etc ...
@@ -66,11 +66,11 @@ tusbd_descriptor_pointer_t tusbd_descriptor_pointers;
/** \defgroup config_device_class Class Driver
* \brief For each Class Driver a value of 1 means enable, value of 0 mean disable
* @{ */
-#define TUSB_CFG_DEVICE_HID_KEYBOARD ///< Enable HID Class for Keyboard
-#define TUSB_CFG_DEVICE_HID_MOUSE ///< Enable HID Class for Mouse
-#define TUSB_CFG_DEVICE_HID_GENERIC ///< Enable HID Class for Generic (not supported yet)
-#define TUSB_CFG_DEVICE_MSC ///< Enable Mass Storage Class (SCSI subclass only)
-#define TUSB_CFG_DEVICE_CDC ///< Enable Virtual Serial (Communication Device Class)
+#define CFG_TUSB_DEVICE_HID_KEYBOARD ///< Enable HID Class for Keyboard
+#define CFG_TUSB_DEVICE_HID_MOUSE ///< Enable HID Class for Mouse
+#define CFG_TUSB_DEVICE_HID_GENERIC ///< Enable HID Class for Generic (not supported yet)
+#define CFG_TUSB_DEVICE_MSC ///< Enable Mass Storage Class (SCSI subclass only)
+#define CFG_TUSB_DEVICE_CDC ///< Enable Virtual Serial (Communication Device Class)
/** @} */
/** @} */ // group Device
diff --git a/doxygen/getting_started.md b/doxygen/getting_started.md
index d58634845..79bc8f01f 100644
--- a/doxygen/getting_started.md
+++ b/doxygen/getting_started.md
@@ -35,7 +35,7 @@ It is relatively simple to incorporate tinyusb to your (existing) project
1. Copy core folder **tinyusb** to your project. Let's say it is *your_project/tinyusb*
2. Add all the .c in the core folder to your project settings (uvproj, ewp, makefile)
3. Add *your_project/tinysb* to your include path. Also make sure your current include path also contains the configuration file tusb_config.h. Or you could simply put the tusb_config.h into the tinyusb folder as well.
-4. Make sure all required macros are all defined properly in tusb_config.h (configure file in demo application is sufficient, but you need to add a few more such as TUSB_CFG_MCU, TUSB_CFG_OS, TUSB_CFG_OS_TASK_PRIO since they are passed by IDE/compiler to maintain a unique configure for all demo projects).
+4. Make sure all required macros are all defined properly in tusb_config.h (configure file in demo application is sufficient, but you need to add a few more such as CFG_TUSB_MCU, CFG_TUSB_OS, CFG_TUSB_OS_TASK_PRIO since they are passed by IDE/compiler to maintain a unique configure for all demo projects).
5. If you use the device stack, make sure you have created/modified usb descriptors for your own need. Ultimately you need to fill out required pointers in tusbd_descriptor_pointers for that stack to work.
6. Add tusb_init() call to your reset initialization code.
7. Implement all enabled classes's callbacks.
diff --git a/doxygen/started_demo.md b/doxygen/started_demo.md
index 287c55731..7e82596f5 100644
--- a/doxygen/started_demo.md
+++ b/doxygen/started_demo.md
@@ -34,7 +34,7 @@ void led_blinking_task( void * p_task_para )
static uint32_t led_on_mask = 0;
// FreeRTOS API's vTaskDelay is used in place of osal_task_delay. Note it takes input parameter in tick
- vTaskDelay( (led_blink_interval_ms * TUSB_CFG_TICKS_HZ) / 1000);
+ vTaskDelay( (led_blink_interval_ms * CFG_TUSB_TICKS_HZ) / 1000);
board_leds(led_on_mask, 1 - led_on_mask);
led_on_mask = 1 - led_on_mask; // toggle
diff --git a/examples/device/device_virtual_com/segger/device_virtual_com.emProject b/examples/device/device_virtual_com/segger/device_virtual_com.emProject
index c52698a89..63927ff9d 100644
--- a/examples/device/device_virtual_com/segger/device_virtual_com.emProject
+++ b/examples/device/device_virtual_com/segger/device_virtual_com.emProject
@@ -201,7 +201,7 @@
</folder>
<configuration
Name="EA4357"
- c_preprocessor_definitions="BOARD=BOARD_EA4357;TUSB_CFG_MCU=MCU_LPC43XX" />
+ c_preprocessor_definitions="BOARD=BOARD_EA4357;CFG_TUSB_MCU=MCU_LPC43XX" />
</project>
<configuration
Name="Debug"
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) ) )
diff --git a/examples/device/device_virtual_com/xpresso/.cproject b/examples/device/device_virtual_com/xpresso/.cproject
index 346f46d92..ffe0a240e 100644
--- a/examples/device/device_virtual_com/xpresso/.cproject
+++ b/examples/device/device_virtual_com/xpresso/.cproject
@@ -31,7 +31,7 @@
<listOptionValue builtIn="false" value="__LPC43XX__"/>
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_EA4357"/>
</option>
<option id="gnu.c.compiler.option.misc.other.1756693195" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fsingle-precision-constant" valueType="string"/>
diff --git a/examples/device/nrf52840/src/main.c b/examples/device/nrf52840/src/main.c
index 203cd3f18..bb26f3a4e 100644
--- a/examples/device/nrf52840/src/main.c
+++ b/examples/device/nrf52840/src/main.c
@@ -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");
}
diff --git a/examples/device/nrf52840/src/msc_device_app.c b/examples/device/nrf52840/src/msc_device_app.c
index 401a32d1d..6609257e2 100644
--- a/examples/device/nrf52840/src/msc_device_app.c
+++ b/examples/device/nrf52840/src/msc_device_app.c
@@ -38,7 +38,7 @@
#include "msc_device_app.h"
-#if TUSB_CFG_DEVICE_MSC
+#if CFG_TUSB_DEVICE_MSC
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
diff --git a/examples/device/nrf52840/src/msc_device_app.h b/examples/device/nrf52840/src/msc_device_app.h
index cd087b8a3..185ceb260 100644
--- a/examples/device/nrf52840/src/msc_device_app.h
+++ b/examples/device/nrf52840/src/msc_device_app.h
@@ -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
diff --git a/examples/device/nrf52840/src/msc_device_ramdisk.c b/examples/device/nrf52840/src/msc_device_ramdisk.c
index fefbfdf79..b19b37252 100644
--- a/examples/device/nrf52840/src/msc_device_ramdisk.c
+++ b/examples/device/nrf52840/src/msc_device_ramdisk.c
@@ -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 -------------//
diff --git a/examples/device/nrf52840/src/tusb_config.h b/examples/device/nrf52840/src/tusb_config.h
index e517376c3..54ec51cce 100644
--- a/examples/device/nrf52840/src/tusb_config.h
+++ b/examples/device/nrf52840/src/tusb_config.h
@@ -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)
diff --git a/examples/device/nrf52840/src/tusb_descriptors.c b/examples/device/nrf52840/src/tusb_descriptors.c
index a36786961..99a47618a 100644
--- a/examples/device/nrf52840/src/tusb_descriptors.c
+++ b/examples/device/nrf52840/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/nrf52840/src/tusb_descriptors.h b/examples/device/nrf52840/src/tusb_descriptors.h
index cf291e25e..b8d07357e 100644
--- a/examples/device/nrf52840/src/tusb_descriptors.h
+++ b/examples/device/nrf52840/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) ) )
diff --git a/examples/obsolete/device/device_freertos/.cproject b/examples/obsolete/device/device_freertos/.cproject
index e3c134ea3..9a17de18e 100644
--- a/examples/obsolete/device/device_freertos/.cproject
+++ b/examples/obsolete/device/device_freertos/.cproject
@@ -32,9 +32,9 @@
<option id="com.crt.advproject.gcc.thumb.697143257" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.371325215" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_FREERTOS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC13UXX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_FREERTOS"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC13UXX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_LPCXPRESSO1347"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
@@ -129,10 +129,10 @@
<option id="gnu.c.compiler.option.preprocessor.def.symbols.690334585" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC11UXX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC11UXX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_LPCXPRESSO11U68"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_FREERTOS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_FREERTOS"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
@@ -226,10 +226,10 @@
<option id="gnu.c.compiler.option.preprocessor.def.symbols.211439980" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_FREERTOS"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_FREERTOS"/>
<listOptionValue builtIn="false" value="CORE_M4"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_EA4357"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
@@ -330,10 +330,10 @@
<option id="com.crt.advproject.gcc.thumb.530159727" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.216849614" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC175X_6X "/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC175X_6X "/>
<listOptionValue builtIn="false" value="BOARD=BOARD_LPCXPRESSO1769"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_FREERTOS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_FREERTOS"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
@@ -428,10 +428,10 @@
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
<listOptionValue builtIn="false" value="CORE_M4"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_NGX4330"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_FREERTOS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_FREERTOS"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
@@ -527,10 +527,10 @@
<option id="gnu.c.compiler.option.preprocessor.def.symbols.2019019201" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC11UXX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC11UXX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_LPCXPRESSO11U14"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_FREERTOS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_FREERTOS"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
diff --git a/examples/obsolete/device/device_os_none/.cproject b/examples/obsolete/device/device_os_none/.cproject
index b09c3d9cd..a8cd67cf2 100644
--- a/examples/obsolete/device/device_os_none/.cproject
+++ b/examples/obsolete/device/device_os_none/.cproject
@@ -32,8 +32,8 @@
<option id="com.crt.advproject.gcc.thumb.697143257" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.371325215" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_NONE"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC13UXX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_NONE"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC13UXX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_LPCXPRESSO1347"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
@@ -125,9 +125,9 @@
<option id="com.crt.advproject.gcc.thumb.1429919562" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.690334585" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_NONE"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_NONE"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC11UXX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC11UXX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_LPCXPRESSO11U68"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
@@ -218,10 +218,10 @@
<option id="com.crt.advproject.gcc.arch.1901283003" name="Architecture" superClass="com.crt.advproject.gcc.arch" useByScannerDiscovery="false" value="com.crt.advproject.gcc.target.cm4" valueType="enumerated"/>
<option id="com.crt.advproject.gcc.thumb.1993301691" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.211439980" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_NONE"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_NONE"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
<listOptionValue builtIn="false" value="CORE_M4"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_EA4357"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
@@ -323,8 +323,8 @@
<option id="com.crt.advproject.gcc.thumb.530159727" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.216849614" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_NONE"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC175X_6X"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_NONE"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC175X_6X"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_LPCXPRESSO1769"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
@@ -418,10 +418,10 @@
<option id="com.crt.advproject.gcc.thumb.1913988235" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.752273048" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_NONE"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_NONE"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
<listOptionValue builtIn="false" value="CORE_M4"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_NGX4330"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
@@ -515,9 +515,9 @@
<option id="com.crt.advproject.gcc.thumb.2139107433" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.2019019201" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_NONE"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_NONE"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC11UXX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC11UXX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_LPCXPRESSO11U14"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
diff --git a/examples/obsolete/device/src/app_os_prio.h b/examples/obsolete/device/src/app_os_prio.h
index 5d932a41e..e75b942ce 100644
--- a/examples/obsolete/device/src/app_os_prio.h
+++ b/examples/obsolete/device/src/app_os_prio.h
@@ -46,16 +46,16 @@
#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
#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/device/src/cdc_device_app.c b/examples/obsolete/device/src/cdc_device_app.c
index 7f448de05..d72e6bcd9 100644
--- a/examples/obsolete/device/src/cdc_device_app.c
+++ b/examples/obsolete/device/src/cdc_device_app.c
@@ -38,7 +38,7 @@
#include "cdc_device_app.h"
-#if TUSB_CFG_DEVICE_CDC
+#if CFG_TUSB_DEVICE_CDC
#include "common/tusb_fifo.h" // TODO refractor
#include "app_os_prio.h"
diff --git a/examples/obsolete/device/src/cdc_device_app.h b/examples/obsolete/device/src/cdc_device_app.h
index a2cd70eb7..45f02baef 100644
--- a/examples/obsolete/device/src/cdc_device_app.h
+++ b/examples/obsolete/device/src/cdc_device_app.h
@@ -53,7 +53,7 @@
extern "C" {
#endif
-#if TUSB_CFG_DEVICE_CDC
+#if CFG_TUSB_DEVICE_CDC
void cdc_serial_app_init(void);
void cdc_serial_app_task(void* param);
diff --git a/examples/obsolete/device/src/keyboard_device_app.c b/examples/obsolete/device/src/keyboard_device_app.c
index 64087053a..a4ae81a46 100644
--- a/examples/obsolete/device/src/keyboard_device_app.c
+++ b/examples/obsolete/device/src/keyboard_device_app.c
@@ -38,7 +38,7 @@
#include "keyboard_device_app.h"
-#if TUSB_CFG_DEVICE_HID_KEYBOARD
+#if CFG_TUSB_DEVICE_HID_KEYBOARD
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
@@ -51,7 +51,7 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM hid_keyboard_report_t keyboard_report;
+CFG_TUSB_ATTR_USBRAM hid_keyboard_report_t keyboard_report;
//--------------------------------------------------------------------+
// tinyusb callbacks
diff --git a/examples/obsolete/device/src/keyboard_device_app.h b/examples/obsolete/device/src/keyboard_device_app.h
index 4d069ae39..1d2a8b39e 100644
--- a/examples/obsolete/device/src/keyboard_device_app.h
+++ b/examples/obsolete/device/src/keyboard_device_app.h
@@ -53,7 +53,7 @@
extern "C" {
#endif
-#if TUSB_CFG_DEVICE_HID_KEYBOARD
+#if CFG_TUSB_DEVICE_HID_KEYBOARD
void keyboard_app_init(void);
void keyboard_app_task(void* param);
diff --git a/examples/obsolete/device/src/main.c b/examples/obsolete/device/src/main.c
index 0cd9eb3bc..802883ce4 100644
--- a/examples/obsolete/device/src/main.c
+++ b/examples/obsolete/device/src/main.c
@@ -64,7 +64,7 @@ void led_blinking_init(void);
void led_blinking_task(void* param);
-#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)
{
@@ -97,9 +97,9 @@ int main(void)
cdc_serial_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();
#else
#error need to start RTOS schduler
@@ -193,9 +193,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/obsolete/device/src/mouse_device_app.c b/examples/obsolete/device/src/mouse_device_app.c
index b04ef7133..3cc2e0d68 100644
--- a/examples/obsolete/device/src/mouse_device_app.c
+++ b/examples/obsolete/device/src/mouse_device_app.c
@@ -38,7 +38,7 @@
#include "mouse_device_app.h"
-#if TUSB_CFG_DEVICE_HID_MOUSE
+#if CFG_TUSB_DEVICE_HID_MOUSE
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
@@ -51,7 +51,7 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM hid_mouse_report_t mouse_report;
+CFG_TUSB_ATTR_USBRAM hid_mouse_report_t mouse_report;
//--------------------------------------------------------------------+
// tinyusb callbacks
diff --git a/examples/obsolete/device/src/mouse_device_app.h b/examples/obsolete/device/src/mouse_device_app.h
index f39f8e30f..48bfb3315 100644
--- a/examples/obsolete/device/src/mouse_device_app.h
+++ b/examples/obsolete/device/src/mouse_device_app.h
@@ -53,7 +53,7 @@
extern "C" {
#endif
-#if TUSB_CFG_DEVICE_HID_MOUSE
+#if CFG_TUSB_DEVICE_HID_MOUSE
void mouse_app_init(void);
void mouse_app_task(void * param);
diff --git a/examples/obsolete/device/src/msc_device_app.c b/examples/obsolete/device/src/msc_device_app.c
index 5650d8b71..df78ccd6e 100644
--- a/examples/obsolete/device/src/msc_device_app.c
+++ b/examples/obsolete/device/src/msc_device_app.c
@@ -38,7 +38,7 @@
#include "msc_device_app.h"
-#if TUSB_CFG_DEVICE_MSC
+#if CFG_TUSB_DEVICE_MSC
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
diff --git a/examples/obsolete/device/src/msc_device_app.h b/examples/obsolete/device/src/msc_device_app.h
index cd087b8a3..185ceb260 100644
--- a/examples/obsolete/device/src/msc_device_app.h
+++ b/examples/obsolete/device/src/msc_device_app.h
@@ -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
diff --git a/examples/obsolete/device/src/msc_device_ramdisk.c b/examples/obsolete/device/src/msc_device_ramdisk.c
index 294e0b792..e2a7a110f 100644
--- a/examples/obsolete/device/src/msc_device_ramdisk.c
+++ b/examples/obsolete/device/src/msc_device_ramdisk.c
@@ -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
+CFG_TUSB_ATTR_USBRAM
uint8_t msc_device_ramdisk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
{
//------------- Boot Sector -------------//
diff --git a/examples/obsolete/device/src/msc_device_romdisk.c b/examples/obsolete/device/src/msc_device_romdisk.c
index 16c8fe518..9f80c8001 100644
--- a/examples/obsolete/device/src/msc_device_romdisk.c
+++ b/examples/obsolete/device/src/msc_device_romdisk.c
@@ -38,7 +38,7 @@
#include "msc_device_app.h"
-#if TUSB_CFG_DEVICE_MSC && defined (MSCD_APP_ROMDISK)
+#if CFG_TUSB_DEVICE_MSC && defined (MSCD_APP_ROMDISK)
//--------------------------------------------------------------------+
// INCLUDE
@@ -91,7 +91,7 @@ const uint8_t msc_device_app_rommdisk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
[3] = README_CONTENTS
};
-TUSB_CFG_ATTR_USBRAM
+CFG_TUSB_ATTR_USBRAM
static uint8_t sector_buffer[DISK_BLOCK_SIZE];
//--------------------------------------------------------------------+
diff --git a/examples/obsolete/device/src/tusb_config.h b/examples/obsolete/device/src/tusb_config.h
index f33fb46ba..6a841d28c 100644
--- a/examples/obsolete/device/src/tusb_config.h
+++ b/examples/obsolete/device/src/tusb_config.h
@@ -46,62 +46,62 @@
//--------------------------------------------------------------------+
// 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 1
-#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 1
+#define CFG_TUSB_DEVICE_HID_KEYBOARD 1
+#define CFG_TUSB_DEVICE_HID_MOUSE 1
+#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 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
//--------------------------------------------------------------------+
// 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
#else
@@ -111,7 +111,7 @@
#endif
// 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)
diff --git a/examples/obsolete/device/src/tusb_descriptors.c b/examples/obsolete/device/src/tusb_descriptors.c
index bd279dc93..ca71d60e3 100644
--- a/examples/obsolete/device/src/tusb_descriptors.c
+++ b/examples/obsolete/device/src/tusb_descriptors.c
@@ -41,7 +41,7 @@
//--------------------------------------------------------------------+
// Keyboard Report Descriptor
//--------------------------------------------------------------------+
-#if TUSB_CFG_DEVICE_HID_KEYBOARD
+#if CFG_TUSB_DEVICE_HID_KEYBOARD
uint8_t const desc_keyboard_report[] = {
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
HID_USAGE ( HID_USAGE_DESKTOP_KEYBOARD ),
@@ -87,7 +87,7 @@ uint8_t const desc_keyboard_report[] = {
//--------------------------------------------------------------------+
// Mouse Report Descriptor
//--------------------------------------------------------------------+
-#if TUSB_CFG_DEVICE_HID_MOUSE
+#if CFG_TUSB_DEVICE_HID_MOUSE
uint8_t const desc_mouse_report[] = {
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
HID_USAGE ( HID_USAGE_DESKTOP_MOUSE ),
@@ -140,7 +140,7 @@ tusb_desc_device_t const desc_device =
.bLength = sizeof(tusb_desc_device_t),
.bDescriptorType = TUSB_DESC_DEVICE,
.bcdUSB = 0x0200,
- #if TUSB_CFG_DEVICE_CDC
+ #if CFG_TUSB_DEVICE_CDC
// Use Interface Association Descriptor (IAD) for CDC
// As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
.bDeviceClass = TUSB_CLASS_MISC,
@@ -152,7 +152,7 @@ tusb_desc_device_t const desc_device =
.bDeviceProtocol = 0x00,
#endif
- .bMaxPacketSize0 = TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE,
+ .bMaxPacketSize0 = CFG_TUSB_DEVICE_CONTROL_ENDOINT_SIZE,
.idVendor = CFG_VENDORID,
.idProduct = CFG_PRODUCTID,
@@ -184,7 +184,7 @@ app_descriptor_configuration_t const desc_configuration =
.bMaxPower = TUSB_DESC_CONFIG_POWER_MA(500)
},
- #if TUSB_CFG_DEVICE_CDC
+ #if CFG_TUSB_DEVICE_CDC
// IAD points to CDC Interfaces
.cdc_iad =
{
@@ -296,7 +296,7 @@ app_descriptor_configuration_t const desc_configuration =
#endif
//------------- HID Keyboard -------------//
- #if TUSB_CFG_DEVICE_HID_KEYBOARD
+ #if CFG_TUSB_DEVICE_HID_KEYBOARD
.keyboard_interface =
{
.bLength = sizeof(tusb_desc_interface_t),
@@ -333,7 +333,7 @@ app_descriptor_configuration_t const desc_configuration =
#endif
//------------- HID Mouse -------------//
- #if TUSB_CFG_DEVICE_HID_MOUSE
+ #if CFG_TUSB_DEVICE_HID_MOUSE
.mouse_interface =
{
.bLength = sizeof(tusb_desc_interface_t),
@@ -370,7 +370,7 @@ app_descriptor_configuration_t const desc_configuration =
#endif
//------------- Mass Storage -------------//
- #if TUSB_CFG_DEVICE_MSC
+ #if CFG_TUSB_DEVICE_MSC
.msc_interface =
{
.bLength = sizeof(tusb_desc_interface_t),
@@ -465,11 +465,11 @@ tusbd_descriptor_pointer_t tusbd_descriptor_pointers =
.p_configuration = (uint8_t const * ) &desc_configuration,
.p_string_arr = (uint8_t const **) string_descriptor_arr,
- #if TUSB_CFG_DEVICE_HID_KEYBOARD
+ #if CFG_TUSB_DEVICE_HID_KEYBOARD
.p_hid_keyboard_report = (uint8_t const *) desc_keyboard_report,
#endif
- #if TUSB_CFG_DEVICE_HID_MOUSE
+ #if CFG_TUSB_DEVICE_HID_MOUSE
.p_hid_mouse_report = (uint8_t const *) desc_mouse_report,
#endif
};
diff --git a/examples/obsolete/device/src/tusb_descriptors.h b/examples/obsolete/device/src/tusb_descriptors.h
index 0ef98e695..274ad00e2 100644
--- a/examples/obsolete/device/src/tusb_descriptors.h
+++ b/examples/obsolete/device/src/tusb_descriptors.h
@@ -50,22 +50,22 @@
// 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) ) )
#endif
#define ITF_NUM_CDC 0
-#define INTERFACE_NO_HID_KEYBOARD (ITF_NUM_CDC + 2*(TUSB_CFG_DEVICE_CDC ? 1 : 0) )
-#define INTERFACE_NO_HID_MOUSE (INTERFACE_NO_HID_KEYBOARD + TUSB_CFG_DEVICE_HID_KEYBOARD )
-#define INTERFACE_NO_HID_GENERIC (INTERFACE_NO_HID_MOUSE + TUSB_CFG_DEVICE_HID_MOUSE )
-#define ITF_NUM_MSC (INTERFACE_NO_HID_GENERIC + TUSB_CFG_DEVICE_HID_GENERIC )
+#define INTERFACE_NO_HID_KEYBOARD (ITF_NUM_CDC + 2*(CFG_TUSB_DEVICE_CDC ? 1 : 0) )
+#define INTERFACE_NO_HID_MOUSE (INTERFACE_NO_HID_KEYBOARD + CFG_TUSB_DEVICE_HID_KEYBOARD )
+#define INTERFACE_NO_HID_GENERIC (INTERFACE_NO_HID_MOUSE + CFG_TUSB_DEVICE_HID_MOUSE )
+#define ITF_NUM_MSC (INTERFACE_NO_HID_GENERIC + CFG_TUSB_DEVICE_HID_GENERIC )
-#define ITF_TOTAL (2*TUSB_CFG_DEVICE_CDC + TUSB_CFG_DEVICE_HID_KEYBOARD + TUSB_CFG_DEVICE_HID_MOUSE + \
- TUSB_CFG_DEVICE_HID_GENERIC + TUSB_CFG_DEVICE_MSC)
+#define ITF_TOTAL (2*CFG_TUSB_DEVICE_CDC + CFG_TUSB_DEVICE_HID_KEYBOARD + CFG_TUSB_DEVICE_HID_MOUSE + \
+ CFG_TUSB_DEVICE_HID_GENERIC + CFG_TUSB_DEVICE_MSC)
-#if (TUSB_CFG_MCU == MCU_LPC11UXX || TUSB_CFG_MCU == MCU_LPC13UXX) && (ITF_TOTAL > 4)
+#if (CFG_TUSB_MCU == MCU_LPC11UXX || CFG_TUSB_MCU == MCU_LPC13UXX) && (ITF_TOTAL > 4)
#error These MCUs do not have enough number of endpoints for the current configuration
#endif
@@ -75,7 +75,7 @@
#define EDPT_IN(x) (0x80 | (x))
#define EDPT_OUT(x) (x)
-#if TUSB_CFG_MCU == MCU_LPC175X_6X // MCUs's endpoint number has a fixed type
+#if CFG_TUSB_MCU == MCU_LPC175X_6X // MCUs's endpoint number has a fixed type
//------------- CDC -------------//
#define CDC_EDPT_NOTIF EDPT_IN (1)
@@ -125,7 +125,7 @@
#endif
-#define MSC_EDPT_PACKETSIZE (TUSB_CFG_MCU == MCU_LPC43XX ? 512 : 64)
+#define MSC_EDPT_PACKETSIZE (CFG_TUSB_MCU == MCU_LPC43XX ? 512 : 64)
//--------------------------------------------------------------------+
// CONFIGURATION DESCRIPTOR
@@ -135,7 +135,7 @@ typedef struct ATTR_PACKED
tusb_desc_configuration_t configuration;
//------------- CDC -------------//
-#if TUSB_CFG_DEVICE_CDC
+#if CFG_TUSB_DEVICE_CDC
tusb_desc_interface_assoc_t cdc_iad;
//CDC Control Interface
@@ -153,21 +153,21 @@ typedef struct ATTR_PACKED
#endif
//------------- HID Keyboard -------------//
-#if TUSB_CFG_DEVICE_HID_KEYBOARD
+#if CFG_TUSB_DEVICE_HID_KEYBOARD
tusb_desc_interface_t keyboard_interface;
tusb_hid_descriptor_hid_t keyboard_hid;
tusb_desc_endpoint_t keyboard_endpoint;
#endif
//------------- HID Mouse -------------//
-#if TUSB_CFG_DEVICE_HID_MOUSE
+#if CFG_TUSB_DEVICE_HID_MOUSE
tusb_desc_interface_t mouse_interface;
tusb_hid_descriptor_hid_t mouse_hid;
tusb_desc_endpoint_t mouse_endpoint;
#endif
//------------- Mass Storage -------------//
-#if TUSB_CFG_DEVICE_MSC
+#if CFG_TUSB_DEVICE_MSC
tusb_desc_interface_t msc_interface;
tusb_desc_endpoint_t msc_endpoint_in;
tusb_desc_endpoint_t msc_endpoint_out;
diff --git a/examples/obsolete/host/host_freertos/.cproject b/examples/obsolete/host/host_freertos/.cproject
index fe0ec307f..fc0a70c7b 100644
--- a/examples/obsolete/host/host_freertos/.cproject
+++ b/examples/obsolete/host/host_freertos/.cproject
@@ -35,10 +35,10 @@
<listOptionValue builtIn="false" value="__FPU_PRESENT"/>
<listOptionValue builtIn="false" value="__USE_CMSIS=CMSIS_LPC43xx_DriverLib"/>
<listOptionValue builtIn="false" value="CORE_M4"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_NGX4330"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_FREERTOS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS_TASK_PRIO=(configMAX_PRIORITIES-5)"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_FREERTOS"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS_TASK_PRIO=(configMAX_PRIORITIES-5)"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
@@ -134,10 +134,10 @@
<listOptionValue builtIn="false" value="__FPU_PRESENT"/>
<listOptionValue builtIn="false" value="__USE_CMSIS=CMSIS_LPC43xx_DriverLib"/>
<listOptionValue builtIn="false" value="CORE_M4"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_EA4357"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_FREERTOS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_FREERTOS"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS_TASK_PRIO=configMAX_PRIORITIES-5"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
@@ -231,9 +231,9 @@
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1650588201" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC175X_6X"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC175X_6X"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_LPCXPRESSO1769"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_NONE"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_NONE"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
</option>
@@ -305,10 +305,10 @@
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1650588201" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC175X_6X"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC175X_6X"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_LPCXPRESSO1769"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_FREERTOS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS_TASK_PRIO=(configMAX_PRIORITIES-5)"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_FREERTOS"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS_TASK_PRIO=(configMAX_PRIORITIES-5)"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
@@ -422,10 +422,10 @@
<listOptionValue builtIn="false" value="__FPU_PRESENT"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
<listOptionValue builtIn="false" value="CORE_M4"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_MCB4300"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_FREERTOS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS_TASK_PRIO=(configMAX_PRIORITIES-5)"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_FREERTOS"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS_TASK_PRIO=(configMAX_PRIORITIES-5)"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
diff --git a/examples/obsolete/host/host_os_none/.cproject b/examples/obsolete/host/host_os_none/.cproject
index 3852d5d35..f282a4abe 100644
--- a/examples/obsolete/host/host_os_none/.cproject
+++ b/examples/obsolete/host/host_os_none/.cproject
@@ -34,9 +34,9 @@
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__USE_CMSIS=CMSIS_LPC43xx_DriverLib"/>
<listOptionValue builtIn="false" value="CORE_M4"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_NGX4330"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_NONE"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_NONE"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
@@ -128,9 +128,9 @@
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__USE_CMSIS=CMSIS_LPC43xx_DriverLib"/>
<listOptionValue builtIn="false" value="CORE_M4"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_EA4357"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_NONE"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_NONE"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
@@ -223,9 +223,9 @@
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
<listOptionValue builtIn="false" value="CORE_M4"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_MCB4300"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_NONE"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_NONE"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
@@ -315,9 +315,9 @@
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1650588201" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC175X_6X"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC175X_6X"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_LPCXPRESSO1769"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_NONE"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_OS=TUSB_OS_NONE"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
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
diff --git a/examples/readme.md b/examples/readme.md
index 6e87b4f45..407638da7 100644
--- a/examples/readme.md
+++ b/examples/readme.md
@@ -55,7 +55,7 @@ IAR is just as easy as Keil
## Configure demo
-Application demo is written to have the code excluded if its required option is not enabled in [tusb_config.h](). Some of combination may exceed the 32KB limit of IAR/Keil so you may want to re-configure to disable some class support, decrease TUSB_CFG_DEBUG or increase the compiler optimization level.
+Application demo is written to have the code excluded if its required option is not enabled in [tusb_config.h](). Some of combination may exceed the 32KB limit of IAR/Keil so you may want to re-configure to disable some class support, decrease CFG_TUSB_DEBUG or increase the compiler optimization level.
In addition, there are some configuration you can change such as
diff --git a/hw/bsp/ea4357/board_ea4357.c b/hw/bsp/ea4357/board_ea4357.c
index 549eb70f7..fdb8adb8b 100644
--- a/hw/bsp/ea4357/board_ea4357.c
+++ b/hw/bsp/ea4357/board_ea4357.c
@@ -68,7 +68,7 @@ enum {
/*------------------------------------------------------------------*/
/* TUSB HAL MILLISECOND
*------------------------------------------------------------------*/
-#if TUSB_CFG_OS == TUSB_OS_NONE
+#if CFG_TUSB_OS == TUSB_OS_NONE
volatile uint32_t system_ticks = 0;
@@ -91,7 +91,7 @@ void board_init(void)
{
CGU_Init();
-#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
+#if CFG_TUSB_OS == TUSB_OS_NONE // TODO may move to main.c
SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / BOARD_TICKS_HZ); // 1 msec tick timer
#endif
@@ -99,7 +99,7 @@ void board_init(void)
// USB0 Power: EA4357 channel B U20 GPIO26 active low (base board), P2_3 on LPC4357
scu_pinmux(0x02, 3, MD_PUP | MD_EZI, FUNC7); // USB0 VBus Power
- #if TUSB_CFG_CONTROLLER_0_MODE & TUSB_MODE_DEVICE
+ #if CFG_TUSB_CONTROLLER_0_MODE & TUSB_MODE_DEVICE
scu_pinmux(0x09, 5, GPIO_PDN, FUNC4); // P9_5 (GPIO5[18]) (GPIO28 on oem base) as USB connect, active low.
GPIO_SetDir(5, BIT_(18), 1);
#endif
diff --git a/hw/bsp/keil/board_mcb4300.c b/hw/bsp/keil/board_mcb4300.c
index b9a3f4144..55d0dc6ba 100644
--- a/hw/bsp/keil/board_mcb4300.c
+++ b/hw/bsp/keil/board_mcb4300.c
@@ -74,7 +74,7 @@ void board_init(void)
{
CGU_Init();
-#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
+#if CFG_TUSB_OS == TUSB_OS_NONE // TODO may move to main.c
SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / BOARD_TICKS_HZ); // 1 msec tick timer
#endif
diff --git a/hw/bsp/lpcxpresso/board_lpclink2.c b/hw/bsp/lpcxpresso/board_lpclink2.c
index 5f6f18cb6..f5dc00e00 100644
--- a/hw/bsp/lpcxpresso/board_lpclink2.c
+++ b/hw/bsp/lpcxpresso/board_lpclink2.c
@@ -56,7 +56,7 @@ void board_init(void)
{
CGU_Init();
-#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
+#if CFG_TUSB_OS == TUSB_OS_NONE // TODO may move to main.c
SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / BOARD_TICKS_HZ); // 1 msec tick timer
#endif
diff --git a/hw/bsp/lpcxpresso/board_lpcxpresso11u14.c b/hw/bsp/lpcxpresso/board_lpcxpresso11u14.c
index 79df45a36..a93ee21e0 100644
--- a/hw/bsp/lpcxpresso/board_lpcxpresso11u14.c
+++ b/hw/bsp/lpcxpresso/board_lpcxpresso11u14.c
@@ -67,7 +67,7 @@ void board_init(void)
{
SystemInit();
-#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
+#if CFG_TUSB_OS == TUSB_OS_NONE // TODO may move to main.c
SysTick_Config(SystemCoreClock / BOARD_TICKS_HZ); // 1 msec tick timer
#endif
diff --git a/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c b/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c
index 5796c2341..ba21a287e 100644
--- a/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c
+++ b/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c
@@ -58,7 +58,7 @@ void board_init(void)
{
SystemInit();
-#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
+#if CFG_TUSB_OS == TUSB_OS_NONE // TODO may move to main.c
SysTick_Config(SystemCoreClock / BOARD_TICKS_HZ); // 1 msec tick timer
#endif
diff --git a/hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c b/hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c
index c0a870d7e..2730e1768 100644
--- a/hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c
+++ b/hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c
@@ -68,7 +68,7 @@ void board_init(void)
{
SystemInit();
-#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
+#if CFG_TUSB_OS == TUSB_OS_NONE // TODO may move to main.c
SysTick_Config(SystemCoreClock / BOARD_TICKS_HZ); // 1 msec tick timer
#endif
diff --git a/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c b/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c
index 7aceb87f4..ba465e224 100644
--- a/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c
+++ b/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c
@@ -67,7 +67,7 @@ void board_init(void)
{
SystemInit();
-#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
+#if CFG_TUSB_OS == TUSB_OS_NONE // TODO may move to main.c
SysTick_Config(SystemCoreClock / BOARD_TICKS_HZ); // 1 msec tick timer
#endif
diff --git a/hw/bsp/ngx/board_ngx4330.c b/hw/bsp/ngx/board_ngx4330.c
index 63c72756e..41c0beddc 100644
--- a/hw/bsp/ngx/board_ngx4330.c
+++ b/hw/bsp/ngx/board_ngx4330.c
@@ -70,7 +70,7 @@ void board_init(void)
{
CGU_Init();
-#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
+#if CFG_TUSB_OS == TUSB_OS_NONE // TODO may move to main.c
SysTick_Config( CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE)/BOARD_TICKS_HZ ); /* 1 ms Timer */
#endif
diff --git a/hw/mcu/nxp/lpc11uxx/hal_mcu/hal_lpc11uxx.c b/hw/mcu/nxp/lpc11uxx/hal_mcu/hal_lpc11uxx.c
index e8b204639..f7998d5af 100644
--- a/hw/mcu/nxp/lpc11uxx/hal_mcu/hal_lpc11uxx.c
+++ b/hw/mcu/nxp/lpc11uxx/hal_mcu/hal_lpc11uxx.c
@@ -39,7 +39,7 @@
#include "common/tusb_common.h"
#include "hal.h"
-#if TUSB_CFG_MCU == MCU_LPC11UXX
+#if CFG_TUSB_MCU == MCU_LPC11UXX
void tusb_hal_int_enable(uint8_t rhport)
{
diff --git a/hw/mcu/nxp/lpc13uxx/hal_mcu/hal_lpc13uxx.c b/hw/mcu/nxp/lpc13uxx/hal_mcu/hal_lpc13uxx.c
index 89136da97..265729aa9 100644
--- a/hw/mcu/nxp/lpc13uxx/hal_mcu/hal_lpc13uxx.c
+++ b/hw/mcu/nxp/lpc13uxx/hal_mcu/hal_lpc13uxx.c
@@ -39,7 +39,7 @@
#include "common/tusb_common.h"
#include "hal.h"
-#if TUSB_CFG_MCU == MCU_LPC13UXX
+#if CFG_TUSB_MCU == MCU_LPC13UXX
void tusb_hal_int_enable(uint8_t rhport)
{
diff --git a/readme.markdown b/readme.markdown
index 0715adfd4..47eaa419b 100644
--- a/readme.markdown
+++ b/readme.markdown
@@ -45,7 +45,7 @@ In addition to running without an RTOS, tinyusb is an OS-awared stack that can r
### RTOS ###
-Currently the following OS are supported with tinyusb out of the box with a simple change of TUSB_CFG_OS macro.
+Currently the following OS are supported with tinyusb out of the box with a simple change of CFG_TUSB_OS macro.
- **None OS**
- **FreeRTOS**
diff --git a/tests/.cproject b/tests/.cproject
index 8e5a14e6f..9aae91f8c 100644
--- a/tests/.cproject
+++ b/tests/.cproject
@@ -33,7 +33,7 @@
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.694786126" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base"/>
<tool errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="cdt.managedbuild.tool.gnu.c.compiler.mingw.base.1588045403" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.base">
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1484610767" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC43XX"/>
</option>
<option id="gnu.c.compiler.option.preprocessor.undef.symbol.1508960620" name="Undefined symbols (-U)" superClass="gnu.c.compiler.option.preprocessor.undef.symbol"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.451457393" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
diff --git a/tests/lpc175x_6x/project.yml b/tests/lpc175x_6x/project.yml
index f878423fe..10cf23cf3 100644
--- a/tests/lpc175x_6x/project.yml
+++ b/tests/lpc175x_6x/project.yml
@@ -42,7 +42,7 @@
# 1) remove the trailing [] from the :common: section
# 2) add entries to the :common: section (e.g. :test: has TEST defined)
:commmon: &common_defines
- - TUSB_CFG_MCU=MCU_LPC175X_6X -std=gnu99
+ - CFG_TUSB_MCU=MCU_LPC175X_6X -std=gnu99
# - -mx32
- CORE_M4
- __CODE_RED
diff --git a/tests/lpc175x_6x/test/test_usbd.c b/tests/lpc175x_6x/test/test_usbd.c
index 69ba8c151..6ace0085b 100644
--- a/tests/lpc175x_6x/test/test_usbd.c
+++ b/tests/lpc175x_6x/test/test_usbd.c
@@ -128,26 +128,26 @@ void test_usbd_string_descriptor(void)
//------------- manufacturer string descriptor -------------//
- uint32_t const manufacturer_len = sizeof(TUSB_CFG_DEVICE_STRING_MANUFACTURER) - 1;
+ uint32_t const manufacturer_len = sizeof(CFG_TUSB_DEVICE_STRING_MANUFACTURER) - 1;
TEST_ASSERT_EQUAL(manufacturer_len*2 + 2, app_tusb_desc_strings.manufacturer.bLength);
for(uint32_t i=0; i<manufacturer_len; i++)
{
- TEST_ASSERT_EQUAL(TUSB_CFG_DEVICE_STRING_MANUFACTURER[i], app_tusb_desc_strings.manufacturer.unicode_string[i]);
+ TEST_ASSERT_EQUAL(CFG_TUSB_DEVICE_STRING_MANUFACTURER[i], app_tusb_desc_strings.manufacturer.unicode_string[i]);
}
//------------- product string descriptor -------------//
- uint32_t const product_len = sizeof(TUSB_CFG_DEVICE_STRING_PRODUCT) - 1;
+ uint32_t const product_len = sizeof(CFG_TUSB_DEVICE_STRING_PRODUCT) - 1;
TEST_ASSERT_EQUAL(product_len*2 + 2, app_tusb_desc_strings.product.bLength);
for(uint32_t i=0; i < product_len; i++)
{
- TEST_ASSERT_EQUAL(TUSB_CFG_DEVICE_STRING_PRODUCT[i], app_tusb_desc_strings.product.unicode_string[i]);
+ TEST_ASSERT_EQUAL(CFG_TUSB_DEVICE_STRING_PRODUCT[i], app_tusb_desc_strings.product.unicode_string[i]);
}
//------------- serial string descriptor -------------//
- uint32_t const serial_len = sizeof(TUSB_CFG_DEVICE_STRING_SERIAL) - 1;
+ uint32_t const serial_len = sizeof(CFG_TUSB_DEVICE_STRING_SERIAL) - 1;
TEST_ASSERT_EQUAL(serial_len*2 + 2, app_tusb_desc_strings.serial.bLength);
for(uint32_t i=0; i<serial_len; i++)
{
- TEST_ASSERT_EQUAL(TUSB_CFG_DEVICE_STRING_SERIAL[i], app_tusb_desc_strings.serial.unicode_string[i]);
+ TEST_ASSERT_EQUAL(CFG_TUSB_DEVICE_STRING_SERIAL[i], app_tusb_desc_strings.serial.unicode_string[i]);
}
}
diff --git a/tests/lpc18xx_43xx/project.yml b/tests/lpc18xx_43xx/project.yml
index 795bd7031..4db7c9688 100644
--- a/tests/lpc18xx_43xx/project.yml
+++ b/tests/lpc18xx_43xx/project.yml
@@ -43,7 +43,7 @@
# 1) remove the trailing [] from the :common: section
# 2) add entries to the :common: section (e.g. :test: has TEST defined)
:commmon: &common_defines
- - TUSB_CFG_MCU=MCU_LPC43XX -std=gnu99
+ - CFG_TUSB_MCU=MCU_LPC43XX -std=gnu99
# - -mx32
- CORE_M4
- __CODE_RED
diff --git a/tests/lpc18xx_43xx/test/host/cdc/descriptor_cdc.c b/tests/lpc18xx_43xx/test/host/cdc/descriptor_cdc.c
index 6776070df..f71ab453c 100644
--- a/tests/lpc18xx_43xx/test/host/cdc/descriptor_cdc.c
+++ b/tests/lpc18xx_43xx/test/host/cdc/descriptor_cdc.c
@@ -42,7 +42,7 @@
//--------------------------------------------------------------------+
// CDC Serials
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM
+CFG_TUSB_ATTR_USBRAM
const cdc_configuration_desc_t cdc_config_descriptor =
{
.configuration =
@@ -168,7 +168,7 @@ const cdc_configuration_desc_t cdc_config_descriptor =
// CDC RNSID
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM
+CFG_TUSB_ATTR_USBRAM
const cdc_configuration_desc_t rndis_config_descriptor =
{
.configuration =
diff --git a/tests/lpc18xx_43xx/test/host/cdc/test_cdc_host.c b/tests/lpc18xx_43xx/test/host/cdc/test_cdc_host.c
index aa062747c..a74270e8b 100644
--- a/tests/lpc18xx_43xx/test/host/cdc/test_cdc_host.c
+++ b/tests/lpc18xx_43xx/test/host/cdc/test_cdc_host.c
@@ -51,7 +51,7 @@
#include "descriptor_cdc.h"
#include "cdc_host.h"
-#if TUSB_CFG_HOST_CDC_RNDIS // TODO enable
+#if CFG_TUSB_HOST_CDC_RNDIS // TODO enable
#include "cdc_rndis_host.h"
#endif
@@ -63,7 +63,7 @@ static tusb_desc_endpoint_t const * p_endpoint_notification = &cdc_config_descri
static tusb_desc_endpoint_t const * p_endpoint_out = &cdc_config_descriptor.cdc_endpoint_out;
static tusb_desc_endpoint_t const * p_endpoint_in = &cdc_config_descriptor.cdc_endpoint_in;
-extern cdch_data_t cdch_data[TUSB_CFG_HOST_DEVICE_MAX];
+extern cdch_data_t cdch_data[CFG_TUSB_HOST_DEVICE_MAX];
static cdch_data_t * p_cdc = &cdch_data[0];
void setUp(void)
@@ -71,7 +71,7 @@ void setUp(void)
length = 0;
dev_addr = 1;
- memclr_(cdch_data, sizeof(cdch_data_t)*TUSB_CFG_HOST_DEVICE_MAX);
+ memclr_(cdch_data, sizeof(cdch_data_t)*CFG_TUSB_HOST_DEVICE_MAX);
}
void tearDown(void)
diff --git a/tests/lpc18xx_43xx/test/host/cdc/test_cdc_rndis_host.c b/tests/lpc18xx_43xx/test/host/cdc/test_cdc_rndis_host.c
index 4f7624f6b..a493c3b79 100644
--- a/tests/lpc18xx_43xx/test/host/cdc/test_cdc_rndis_host.c
+++ b/tests/lpc18xx_43xx/test/host/cdc/test_cdc_rndis_host.c
@@ -72,8 +72,8 @@ static pipe_handle_t pipe_notification = { .dev_addr = 1, .xfer_type = TUSB_XFER
static pipe_handle_t pipe_out = { .dev_addr = 1, .xfer_type = TUSB_XFER_BULK, .index = 0 };
static pipe_handle_t pipe_in = { .dev_addr = 1, .xfer_type = TUSB_XFER_BULK, .index = 1 };
-extern cdch_data_t cdch_data[TUSB_CFG_HOST_DEVICE_MAX];
-extern rndish_data_t rndish_data[TUSB_CFG_HOST_DEVICE_MAX];
+extern cdch_data_t cdch_data[CFG_TUSB_HOST_DEVICE_MAX];
+extern rndish_data_t rndish_data[CFG_TUSB_HOST_DEVICE_MAX];
static cdch_data_t * p_cdc = &cdch_data[0];
static rndish_data_t * p_rndis = &rndish_data[0];
@@ -93,7 +93,7 @@ void setUp(void)
length = 0;
dev_addr = 1;
- for (uint8_t i=0; i<TUSB_CFG_HOST_DEVICE_MAX; i++)
+ for (uint8_t i=0; i<CFG_TUSB_HOST_DEVICE_MAX; i++)
{
osal_semaphore_create_ExpectAndReturn( &rndish_data[i].semaphore_notification, &rndish_data[i].semaphore_notification);
}
diff --git a/tests/lpc18xx_43xx/test/host/ehci/test_ehci_init.c b/tests/lpc18xx_43xx/test/host/ehci/test_ehci_init.c
index bad29cbfb..f31944338 100644
--- a/tests/lpc18xx_43xx/test/host/ehci/test_ehci_init.c
+++ b/tests/lpc18xx_43xx/test/host/ehci/test_ehci_init.c
@@ -51,7 +51,7 @@
#include "mock_osal.h"
#include "mock_usbh_hcd.h"
-usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1];
+usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
static uint8_t hostid;
diff --git a/tests/lpc18xx_43xx/test/host/ehci/test_ehci_isr.c b/tests/lpc18xx_43xx/test/host/ehci/test_ehci_isr.c
index 8c648505e..6a6beec3d 100644
--- a/tests/lpc18xx_43xx/test/host/ehci/test_ehci_isr.c
+++ b/tests/lpc18xx_43xx/test/host/ehci/test_ehci_isr.c
@@ -50,7 +50,7 @@
#include "mock_osal.h"
#include "mock_usbh_hcd.h"
-usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1];
+usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
static uint8_t hostid;
static ehci_registers_t * regs;
diff --git a/tests/lpc18xx_43xx/test/host/ehci/test_ehci_structure.c b/tests/lpc18xx_43xx/test/host/ehci/test_ehci_structure.c
index 08eb961f0..f35c90509 100644
--- a/tests/lpc18xx_43xx/test/host/ehci/test_ehci_structure.c
+++ b/tests/lpc18xx_43xx/test/host/ehci/test_ehci_structure.c
@@ -51,7 +51,7 @@
#include "mock_osal.h"
#include "mock_usbh_hcd.h"
-usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1];
+usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
//--------------------------------------------------------------------+
// Setup/Teardown + helper declare
diff --git a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_bulk_open.c b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_bulk_open.c
index 83091134e..c2d52ce4c 100644
--- a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_bulk_open.c
+++ b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_bulk_open.c
@@ -51,7 +51,7 @@
#include "ehci_controller_fake.h"
#include "host_helper.h"
-usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1];
+usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
static uint8_t const hub_addr = 2;
static uint8_t const hub_port = 2;
@@ -70,7 +70,7 @@ void setUp(void)
dev_addr = 1;
hostid = RANDOM(CONTROLLER_HOST_NUMBER) + TEST_CONTROLLER_HOST_START_INDEX;
- memclr_(usbh_devices, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1));
+ memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
helper_usbh_device_emulate(dev_addr, hub_addr, hub_port, hostid, TUSB_SPEED_HIGH);
async_head = get_async_head( hostid );
diff --git a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_bulk_xfer.c b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_bulk_xfer.c
index 0231a47e8..e3d78f668 100644
--- a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_bulk_xfer.c
+++ b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_bulk_xfer.c
@@ -51,7 +51,7 @@
#include "ehci_controller_fake.h"
#include "host_helper.h"
-usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1];
+usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
static uint8_t hub_addr = 2;
static uint8_t hub_port = 2;
@@ -91,7 +91,7 @@ void setUp(void)
{
ehci_controller_init();
memclr_(xfer_data, sizeof(xfer_data));
- memclr_(usbh_devices, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1));
+ memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
TEST_ASSERT_STATUS( hcd_init() );
diff --git a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_control_open.c b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_control_open.c
index a42a6ccb2..1143b9faa 100644
--- a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_control_open.c
+++ b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_control_open.c
@@ -51,7 +51,7 @@
#include "ehci_controller_fake.h"
#include "host_helper.h"
-usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1];
+usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
static uint8_t const control_max_packet_size = 64;
static uint8_t const hub_addr = 2;
@@ -67,7 +67,7 @@ static ehci_qhd_t *p_control_qhd;
//--------------------------------------------------------------------+
void setUp(void)
{
- memclr_(usbh_devices, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1));
+ memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
TEST_ASSERT_STATUS( hcd_init() );
diff --git a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_control_xfer.c b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_control_xfer.c
index 556823de2..286aae113 100644
--- a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_control_xfer.c
+++ b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_control_xfer.c
@@ -51,7 +51,7 @@
#include "ehci_controller_fake.h"
#include "host_helper.h"
-usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1];
+usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
static uint8_t const control_max_packet_size = 64;
static uint8_t const hub_addr = 2;
@@ -74,7 +74,7 @@ void setUp(void)
{
ehci_controller_init();
- memclr_(usbh_devices, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1));
+ memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
memclr_(xfer_data, sizeof(xfer_data));
TEST_ASSERT_STATUS( hcd_init() );
diff --git a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_interrupt_open.c b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_interrupt_open.c
index d41140f10..1f8fc9a12 100644
--- a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_interrupt_open.c
+++ b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_interrupt_open.c
@@ -50,7 +50,7 @@
#include "ehci_controller_fake.h"
#include "host_helper.h"
-usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1];
+usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
static uint8_t const hub_addr = 2;
static uint8_t const hub_port = 2;
@@ -67,7 +67,7 @@ static pipe_handle_t pipe_hdl;
//--------------------------------------------------------------------+
void setUp(void)
{
- memclr_(usbh_devices, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1));
+ memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
hcd_init();
diff --git a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_interrupt_xfer.c b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_interrupt_xfer.c
index d724b2c00..cacc1e98c 100644
--- a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_interrupt_xfer.c
+++ b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_interrupt_xfer.c
@@ -51,7 +51,7 @@
#include "ehci_controller_fake.h"
#include "host_helper.h"
-usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1];
+usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
static uint8_t const hub_addr = 2;
static uint8_t const hub_port = 2;
@@ -91,7 +91,7 @@ void setUp(void)
{
ehci_controller_init();
- memclr_(usbh_devices, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1));
+ memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
memclr_(xfer_data, sizeof(xfer_data));
TEST_ASSERT_STATUS( hcd_init() );
diff --git a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_isochronous_open.c b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_isochronous_open.c
index 44f58fcc8..584c44471 100644
--- a/tests/lpc18xx_43xx/test/host/ehci/test_pipe_isochronous_open.c
+++ b/tests/lpc18xx_43xx/test/host/ehci/test_pipe_isochronous_open.c
@@ -50,7 +50,7 @@
#include "ehci_controller_fake.h"
#include "host_helper.h"
-usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1];
+usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
static uint8_t const hub_addr = 2;
static uint8_t const hub_port = 2;
@@ -63,7 +63,7 @@ static ehci_qhd_t *period_head_arr;
//--------------------------------------------------------------------+
void setUp(void)
{
- memclr_(usbh_devices, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1));
+ memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
hcd_init();
diff --git a/tests/lpc18xx_43xx/test/host/hid/test_hid_host.c b/tests/lpc18xx_43xx/test/host/hid/test_hid_host.c
index 0ffa831b9..59ad54c88 100644
--- a/tests/lpc18xx_43xx/test/host/hid/test_hid_host.c
+++ b/tests/lpc18xx_43xx/test/host/hid/test_hid_host.c
@@ -54,7 +54,7 @@
uint8_t dev_addr;
pipe_handle_t pipe_hdl;
-extern hidh_interface_info_t keyboardh_data[TUSB_CFG_HOST_DEVICE_MAX];
+extern hidh_interface_info_t keyboardh_data[CFG_TUSB_HOST_DEVICE_MAX];
tusb_desc_interface_t const *p_kbd_interface_desc = &desc_configuration.keyboard_interface;
tusb_hid_descriptor_hid_t const *p_kbh_hid_desc = &desc_configuration.keyboard_hid;
@@ -62,7 +62,7 @@ tusb_desc_endpoint_t const *p_kdb_endpoint_desc = &desc_configuration.keyboard
void setUp(void)
{
- dev_addr = RANDOM(TUSB_CFG_HOST_DEVICE_MAX)+1;
+ dev_addr = RANDOM(CFG_TUSB_HOST_DEVICE_MAX)+1;
pipe_hdl = (pipe_handle_t) {.dev_addr = dev_addr, .xfer_type = TUSB_XFER_INTERRUPT, .index = 2};
}
diff --git a/tests/lpc18xx_43xx/test/host/hid/test_hidh_generic.c b/tests/lpc18xx_43xx/test/host/hid/test_hidh_generic.c
index 45cd40204..39fdfaf2b 100644
--- a/tests/lpc18xx_43xx/test/host/hid/test_hidh_generic.c
+++ b/tests/lpc18xx_43xx/test/host/hid/test_hidh_generic.c
@@ -54,7 +54,7 @@
#include "host_helper.h"
-extern hidh_interface_info_t mouseh_data[TUSB_CFG_HOST_DEVICE_MAX];
+extern hidh_interface_info_t mouseh_data[CFG_TUSB_HOST_DEVICE_MAX];
hidh_interface_info_t *p_hidh_mouse;
hid_mouse_report_t report;
@@ -68,7 +68,7 @@ void setUp(void)
helper_usbh_init_expect();
usbh_init();
- dev_addr = RANDOM(TUSB_CFG_HOST_DEVICE_MAX)+1;
+ dev_addr = RANDOM(CFG_TUSB_HOST_DEVICE_MAX)+1;
// uint16_t length;
// TEST_ASSERT_STATUS( hidh_open_subtask(dev_addr, p_mouse_interface_desc, &length) );
@@ -92,5 +92,5 @@ void tearDown(void)
//{
// hidh_init();
//
-// TEST_ASSERT_MEM_ZERO(mouse_data, sizeof(hidh_interface_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
+// TEST_ASSERT_MEM_ZERO(mouse_data, sizeof(hidh_interface_info_t)*CFG_TUSB_HOST_DEVICE_MAX);
//}
diff --git a/tests/lpc18xx_43xx/test/host/hid/test_hidh_keyboard.c b/tests/lpc18xx_43xx/test/host/hid/test_hidh_keyboard.c
index 3376737dd..2b109729d 100644
--- a/tests/lpc18xx_43xx/test/host/hid/test_hidh_keyboard.c
+++ b/tests/lpc18xx_43xx/test/host/hid/test_hidh_keyboard.c
@@ -48,7 +48,7 @@
#include "mock_hidh_callback.h"
#include "descriptor_test.h"
-extern hidh_interface_info_t keyboardh_data[TUSB_CFG_HOST_DEVICE_MAX];
+extern hidh_interface_info_t keyboardh_data[CFG_TUSB_HOST_DEVICE_MAX];
hid_keyboard_report_t sample_key[2] =
{
@@ -74,7 +74,7 @@ void setUp(void)
{
hidh_init();
memclr_(&report, sizeof(hid_keyboard_report_t));
- dev_addr = RANDOM(TUSB_CFG_HOST_DEVICE_MAX)+1;
+ dev_addr = RANDOM(CFG_TUSB_HOST_DEVICE_MAX)+1;
p_hidh_kbd = &keyboardh_data[dev_addr-1];
@@ -95,7 +95,7 @@ void test_keyboard_init(void)
{
hidh_init();
- TEST_ASSERT_MEM_ZERO(keyboardh_data, sizeof(hidh_interface_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
+ TEST_ASSERT_MEM_ZERO(keyboardh_data, sizeof(hidh_interface_info_t)*CFG_TUSB_HOST_DEVICE_MAX);
}
//------------- is supported -------------//
diff --git a/tests/lpc18xx_43xx/test/host/hid/test_hidh_mouse.c b/tests/lpc18xx_43xx/test/host/hid/test_hidh_mouse.c
index 51a244c9e..31349798d 100644
--- a/tests/lpc18xx_43xx/test/host/hid/test_hidh_mouse.c
+++ b/tests/lpc18xx_43xx/test/host/hid/test_hidh_mouse.c
@@ -49,7 +49,7 @@
#include "mock_hidh_callback.h"
#include "descriptor_test.h"
-extern hidh_interface_info_t mouseh_data[TUSB_CFG_HOST_DEVICE_MAX];
+extern hidh_interface_info_t mouseh_data[CFG_TUSB_HOST_DEVICE_MAX];
hidh_interface_info_t *p_hidh_mouse;
hid_mouse_report_t report;
@@ -63,7 +63,7 @@ void setUp(void)
hidh_init();
memclr_(&report, sizeof(hid_mouse_report_t));
- dev_addr = RANDOM(TUSB_CFG_HOST_DEVICE_MAX)+1;
+ dev_addr = RANDOM(CFG_TUSB_HOST_DEVICE_MAX)+1;
p_hidh_mouse = &mouseh_data[dev_addr-1];
@@ -84,7 +84,7 @@ void test_mouse_init(void)
{
hidh_init();
- TEST_ASSERT_MEM_ZERO(mouseh_data, sizeof(hidh_interface_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
+ TEST_ASSERT_MEM_ZERO(mouseh_data, sizeof(hidh_interface_info_t)*CFG_TUSB_HOST_DEVICE_MAX);
}
//------------- is supported -------------//
diff --git a/tests/lpc18xx_43xx/test/host/host_helper.h b/tests/lpc18xx_43xx/test/host/host_helper.h
index 90ef24976..c293ec748 100644
--- a/tests/lpc18xx_43xx/test/host/host_helper.h
+++ b/tests/lpc18xx_43xx/test/host/host_helper.h
@@ -42,7 +42,7 @@
static inline void helper_class_init_expect(void)
{ // class code number order
-#if TUSB_CFG_HOST_CDC
+#if CFG_TUSB_HOST_CDC
cdch_init_Expect();
#endif
@@ -50,7 +50,7 @@ static inline void helper_class_init_expect(void)
hidh_init_Expect();
#endif
-#if TUSB_CFG_HOST_MSC
+#if CFG_TUSB_HOST_MSC
msch_init_Expect();
#endif
diff --git a/tests/lpc18xx_43xx/test/host/integration/test_hidh_keyboard_integrate.c b/tests/lpc18xx_43xx/test/host/integration/test_hidh_keyboard_integrate.c
index 1288c42ed..80ca71746 100644
--- a/tests/lpc18xx_43xx/test/host/integration/test_hidh_keyboard_integrate.c
+++ b/tests/lpc18xx_43xx/test/host/integration/test_hidh_keyboard_integrate.c
@@ -56,7 +56,7 @@
//
void setUp(void)
{
-// dev_addr = RANDOM(TUSB_CFG_HOST_DEVICE_MAX)+1;
+// dev_addr = RANDOM(CFG_TUSB_HOST_DEVICE_MAX)+1;
// hostid = RANDOM(CONTROLLER_HOST_NUMBER) + TEST_CONTROLLER_HOST_START_INDEX;
//
//// ehci_controller_init();
diff --git a/tests/lpc18xx_43xx/test/host/msc/test_msc_host.c b/tests/lpc18xx_43xx/test/host/msc/test_msc_host.c
index 93485f7ad..2a752f971 100644
--- a/tests/lpc18xx_43xx/test/host/msc/test_msc_host.c
+++ b/tests/lpc18xx_43xx/test/host/msc/test_msc_host.c
@@ -51,7 +51,7 @@
#include "mock_msch_callback.h"
#include "msc_host.h"
-extern msch_interface_t msch_data[TUSB_CFG_HOST_DEVICE_MAX];
+extern msch_interface_t msch_data[CFG_TUSB_HOST_DEVICE_MAX];
static tusb_desc_interface_t const *p_msc_interface_desc = &desc_configuration.msc_interface;
static tusb_desc_endpoint_t const *p_edp_in = &desc_configuration.msc_endpoint_in;
@@ -66,11 +66,11 @@ static uint16_t length;
void setUp(void)
{
- dev_addr = RANDOM(TUSB_CFG_HOST_DEVICE_MAX)+1;
+ dev_addr = RANDOM(CFG_TUSB_HOST_DEVICE_MAX)+1;
osal_semaphore_create_IgnoreAndReturn( (osal_semaphore_handle_t) 0x1234);
msch_init();
- TEST_ASSERT_MEM_ZERO(msch_data, sizeof(msch_interface_t)*TUSB_CFG_HOST_DEVICE_MAX);
+ TEST_ASSERT_MEM_ZERO(msch_data, sizeof(msch_interface_t)*CFG_TUSB_HOST_DEVICE_MAX);
p_msc = &msch_data[dev_addr-1];
pipe_in = (pipe_handle_t) {.dev_addr = dev_addr, .xfer_type = TUSB_XFER_BULK, .index = 1};
diff --git a/tests/lpc18xx_43xx/test/host/usbh/test_enum_task.c b/tests/lpc18xx_43xx/test/host/usbh/test_enum_task.c
index 438af6896..7aeba21a0 100644
--- a/tests/lpc18xx_43xx/test/host/usbh/test_enum_task.c
+++ b/tests/lpc18xx_43xx/test/host/usbh/test_enum_task.c
@@ -51,8 +51,8 @@
#include "mock_cdc_host.h"
#include "mock_msc_host.h"
-extern usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1];
-extern uint8_t enum_data_buffer[TUSB_CFG_HOST_ENUM_BUFFER_SIZE];
+extern usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
+extern uint8_t enum_data_buffer[CFG_TUSB_HOST_ENUM_BUFFER_SIZE];
usbh_enumerate_t const enum_connect = {
.core_id = 0,
@@ -73,7 +73,7 @@ enum {
void setUp(void)
{
- memclr_(usbh_devices, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1));
+ memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
osal_queue_receive_StubWithCallback(queue_recv_stub);
osal_semaphore_wait_StubWithCallback(semaphore_wait_success_stub);
@@ -164,7 +164,7 @@ tusb_error_t control_xfer_stub(uint8_t dev_addr, const tusb_control_request_t *
case 4: // get full-length configuration descriptor
TEST_ASSERT_EQUAL(TUSB_REQ_GET_DESCRIPTOR, p_request->bRequest);
TEST_ASSERT_EQUAL(TUSB_DESC_TYPE_CONFIGURATION, p_request->wValue >> 8);
- TEST_ASSERT_EQUAL(TUSB_CFG_HOST_ENUM_BUFFER_SIZE, p_request->wLength);
+ TEST_ASSERT_EQUAL(CFG_TUSB_HOST_ENUM_BUFFER_SIZE, p_request->wLength);
memcpy(data, &desc_configuration, p_request->wLength);
break;
diff --git a/tests/lpc18xx_43xx/test/host/usbh/test_usbh.c b/tests/lpc18xx_43xx/test/host/usbh/test_usbh.c
index cede93fd2..7b99b013a 100644
--- a/tests/lpc18xx_43xx/test/host/usbh/test_usbh.c
+++ b/tests/lpc18xx_43xx/test/host/usbh/test_usbh.c
@@ -56,7 +56,7 @@
uint8_t dev_addr;
void setUp(void)
{
- dev_addr = RANDOM(TUSB_CFG_HOST_DEVICE_MAX)+1;
+ dev_addr = RANDOM(CFG_TUSB_HOST_DEVICE_MAX)+1;
}
void tearDown(void)
@@ -70,7 +70,7 @@ void test_usbh_status_get_fail(void)
{
usbh_devices[dev_addr].state = 0;
- TEST_ASSERT_EQUAL( TUSB_DEVICE_STATE_INVALID_PARAMETER, tusbh_device_get_state(TUSB_CFG_HOST_DEVICE_MAX+1) );
+ TEST_ASSERT_EQUAL( TUSB_DEVICE_STATE_INVALID_PARAMETER, tusbh_device_get_state(CFG_TUSB_HOST_DEVICE_MAX+1) );
TEST_ASSERT_EQUAL( TUSB_DEVICE_STATE_UNPLUG, tusbh_device_get_state(dev_addr) );
}
@@ -134,7 +134,7 @@ void test_usbh_init_ok(void)
//------------- code under test -------------//
TEST_ASSERT_EQUAL(TUSB_ERROR_NONE, usbh_init());
- for (uint8_t i=0; i<TUSB_CFG_HOST_DEVICE_MAX+1; i++)
+ for (uint8_t i=0; i<CFG_TUSB_HOST_DEVICE_MAX+1; i++)
{
TEST_ASSERT_NOT_NULL(usbh_devices[i].control.sem_hdl);
}
diff --git a/tests/lpc18xx_43xx/test/test_osal_none.c b/tests/lpc18xx_43xx/test/test_osal_none.c
index d4a97f485..29b311899 100644
--- a/tests/lpc18xx_43xx/test/test_osal_none.c
+++ b/tests/lpc18xx_43xx/test/test_osal_none.c
@@ -36,8 +36,8 @@
*/
/**************************************************************************/
-#ifdef TUSB_CFG_OS
-#undef TUSB_CFG_OS
+#ifdef CFG_TUSB_OS
+#undef CFG_TUSB_OS
#endif
void setUp(void)
@@ -180,7 +180,7 @@ void test_task_with_semaphore(void)
TEST_ASSERT_EQUAL(1, statements[3]);
// timeout
- for(uint32_t i=0; i<(OSAL_TIMEOUT_NORMAL*TUSB_CFG_OS_TICKS_PER_SECOND)/1000 - 1 ; i++) // not enough time
+ for(uint32_t i=0; i<(OSAL_TIMEOUT_NORMAL*CFG_TUSB_OS_TICKS_PER_SECOND)/1000 - 1 ; i++) // not enough time
osal_tick_tock();
sample_task_semaphore();
TEST_ASSERT_EQUAL(0, statements[4]);
@@ -251,7 +251,7 @@ void test_task_with_mutex(void)
TEST_ASSERT_EQUAL(0, statements[5]);
// timeout
- for(uint32_t i=0; i<(OSAL_TIMEOUT_NORMAL*TUSB_CFG_OS_TICKS_PER_SECOND)/1000 - 1 ; i++){ // one tick less
+ for(uint32_t i=0; i<(OSAL_TIMEOUT_NORMAL*CFG_TUSB_OS_TICKS_PER_SECOND)/1000 - 1 ; i++){ // one tick less
osal_tick_tock();
}
mutex_sample_task2();
@@ -321,7 +321,7 @@ void test_task_with_queue(void)
TEST_ASSERT_EQUAL(1, statements[3]);
// timeout
- for(uint32_t i=0; i<(OSAL_TIMEOUT_NORMAL*TUSB_CFG_OS_TICKS_PER_SECOND)/1000 - 1 ; i++) // not enough time
+ for(uint32_t i=0; i<(OSAL_TIMEOUT_NORMAL*CFG_TUSB_OS_TICKS_PER_SECOND)/1000 - 1 ; i++) // not enough time
osal_tick_tock();
sample_task_with_queue();
TEST_ASSERT_EQUAL(0, statements[4]);
@@ -354,7 +354,7 @@ void test_task_with_delay(void)
sample_task_with_delay();
TEST_ASSERT_EQUAL(0, statements[0]);
- for(uint32_t i=0; i<TUSB_CFG_OS_TICKS_PER_SECOND*1000; i++) // not enough time
+ for(uint32_t i=0; i<CFG_TUSB_OS_TICKS_PER_SECOND*1000; i++) // not enough time
osal_tick_tock();
sample_task_with_delay();
@@ -413,7 +413,7 @@ tusb_error_t sample_task_flow_control(void)
void test_task_flow_control_assert(void)
{
sample_task_flow_control();
- for(uint32_t i=0; i<(OSAL_TIMEOUT_NORMAL*TUSB_CFG_OS_TICKS_PER_SECOND)/1000 + 1; i++) osal_tick_tock();
+ for(uint32_t i=0; i<(OSAL_TIMEOUT_NORMAL*CFG_TUSB_OS_TICKS_PER_SECOND)/1000 + 1; i++) osal_tick_tock();
sample_task_flow_control();
TEST_ASSERT_EQUAL(0, statements[1]);
}
@@ -424,7 +424,7 @@ void test_task_flow_control_assert_status(void)
sample_task_flow_control();
- for(uint32_t i=0; i<(OSAL_TIMEOUT_NORMAL*TUSB_CFG_OS_TICKS_PER_SECOND)/1000 + 1; i++) osal_tick_tock();
+ for(uint32_t i=0; i<(OSAL_TIMEOUT_NORMAL*CFG_TUSB_OS_TICKS_PER_SECOND)/1000 + 1; i++) osal_tick_tock();
sample_task_flow_control();
TEST_ASSERT_EQUAL(0, statements[2]);
@@ -436,7 +436,7 @@ void test_task_flow_control_assert_status_hanlder(void)
sample_task_flow_control();
- for(uint32_t i=0; i<(OSAL_TIMEOUT_NORMAL*TUSB_CFG_OS_TICKS_PER_SECOND)/1000 + 1; i++) osal_tick_tock();
+ for(uint32_t i=0; i<(OSAL_TIMEOUT_NORMAL*CFG_TUSB_OS_TICKS_PER_SECOND)/1000 + 1; i++) osal_tick_tock();
sample_task_flow_control();
TEST_ASSERT_EQUAL(0, statements[3]);
diff --git a/tests/support/descriptor_test.c b/tests/support/descriptor_test.c
index d7e7d7521..0998db8b7 100644
--- a/tests/support/descriptor_test.c
+++ b/tests/support/descriptor_test.c
@@ -39,7 +39,7 @@
#include "tusb_option.h"
#include "descriptor_test.h"
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4)
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4)
const uint8_t keyboard_report_descriptor[] = {
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
HID_USAGE ( HID_USAGE_DESKTOP_KEYBOARD ),
@@ -81,7 +81,7 @@ const uint8_t keyboard_report_descriptor[] = {
HID_COLLECTION_END
};
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4)
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4)
const uint8_t mouse_report_descriptor[] = {
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
HID_USAGE ( HID_USAGE_DESKTOP_MOUSE ),
@@ -118,7 +118,7 @@ const uint8_t mouse_report_descriptor[] = {
};
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4)
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4)
tusb_desc_device_t const desc_device =
{
.bLength = sizeof(tusb_desc_device_t),
@@ -142,7 +142,7 @@ tusb_desc_device_t const desc_device =
} ;
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4)
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4)
const app_configuration_desc_t desc_configuration =
{
.configuration =
diff --git a/tests/support/descriptor_test.h b/tests/support/descriptor_test.h
index 1e5801ce4..a0455f4ba 100644
--- a/tests/support/descriptor_test.h
+++ b/tests/support/descriptor_test.h
@@ -69,7 +69,7 @@ typedef struct
tusb_desc_interface_assoc_t CDC_IAD;
#endif
-#if 0 //&& TUSB_CFG_DEVICE_CDC
+#if 0 //&& CFG_TUSB_DEVICE_CDC
//CDC - Serial
//CDC Control Interface
tusb_desc_interface_t CDC_CCI_Interface;
diff --git a/tests/support/ehci_controller_fake.c b/tests/support/ehci_controller_fake.c
index 044ea84f3..04d55172c 100644
--- a/tests/support/ehci_controller_fake.c
+++ b/tests/support/ehci_controller_fake.c
@@ -54,7 +54,7 @@
LPC_USB0_Type lpc_usb0;
LPC_USB1_Type lpc_usb1;
-extern usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1];
+extern usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
//--------------------------------------------------------------------+
// IMPLEMENTATION
diff --git a/tests/support/tusb_config.h b/tests/support/tusb_config.h
index 5d23c6c77..964f3a034 100644
--- a/tests/support/tusb_config.h
+++ b/tests/support/tusb_config.h
@@ -46,49 +46,49 @@
//--------------------------------------------------------------------+
// CONTROLLER CONFIGURATION
//--------------------------------------------------------------------+
-#define TUSB_CFG_CONTROLLER_0_MODE (TUSB_MODE_HOST | TUSB_MODE_DEVICE)
-#define TUSB_CFG_CONTROLLER_1_MODE (TUSB_MODE_NONE)
+#define CFG_TUSB_CONTROLLER_0_MODE (TUSB_MODE_HOST | TUSB_MODE_DEVICE)
+#define CFG_TUSB_CONTROLLER_1_MODE (TUSB_MODE_NONE)
//--------------------------------------------------------------------+
// HOST CONFIGURATION
//--------------------------------------------------------------------+
-#define TUSB_CFG_HOST_DEVICE_MAX 5 // TODO be a part of HUB config
+#define CFG_TUSB_HOST_DEVICE_MAX 5 // TODO be a part of HUB config
//------------- CLASS -------------//
-#define TUSB_CFG_HOST_HUB 0
-#define TUSB_CFG_HOST_HID_KEYBOARD 1
-#define TUSB_CFG_HOST_HID_MOUSE 1
-#define TUSB_CFG_HOST_HID_GENERIC 0
-#define TUSB_CFG_HOST_MSC 1
-#define TUSB_CFG_HOST_CDC 1
-#define TUSB_CFG_HOST_CDC_RNDIS 0
+#define CFG_TUSB_HOST_HUB 0
+#define CFG_TUSB_HOST_HID_KEYBOARD 1
+#define CFG_TUSB_HOST_HID_MOUSE 1
+#define CFG_TUSB_HOST_HID_GENERIC 0
+#define CFG_TUSB_HOST_MSC 1
+#define CFG_TUSB_HOST_CDC 1
+#define CFG_TUSB_HOST_CDC_RNDIS 0
// Test support
#define TEST_CONTROLLER_HOST_START_INDEX \
- ( ((CONTROLLER_HOST_NUMBER == 1) && (TUSB_CFG_CONTROLLER_1_MODE & TUSB_MODE_HOST)) ? 1 : 0)
+ ( ((CONTROLLER_HOST_NUMBER == 1) && (CFG_TUSB_CONTROLLER_1_MODE & TUSB_MODE_HOST)) ? 1 : 0)
//--------------------------------------------------------------------+
// 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 1
-#define TUSB_CFG_DEVICE_HID_MOUSE 1
-#define TUSB_CFG_DEVICE_HID_GENERIC 0
-#define TUSB_CFG_DEVICE_MSC 1
-#define TUSB_CFG_DEVICE_CDC 1
+#define CFG_TUSB_DEVICE_HID_KEYBOARD 1
+#define CFG_TUSB_DEVICE_HID_MOUSE 1
+#define CFG_TUSB_DEVICE_HID_GENERIC 0
+#define CFG_TUSB_DEVICE_MSC 1
+#define CFG_TUSB_DEVICE_CDC 1
//--------------------------------------------------------------------+
// COMMON CONFIGURATION
//--------------------------------------------------------------------+
-#define TUSB_CFG_DEBUG 3
+#define CFG_TUSB_DEBUG 3
-#define TUSB_CFG_OS TUSB_OS_NONE
-#define TUSB_CFG_TICKS_HZ 1000 // 1 ms tick
-#define TUSB_CFG_ATTR_USBRAM
+#define CFG_TUSB_OS TUSB_OS_NONE
+#define CFG_TUSB_TICKS_HZ 1000 // 1 ms tick
+#define CFG_TUSB_ATTR_USBRAM
#ifdef __cplusplus
}
diff --git a/tinyusb.Doxyfile b/tinyusb.Doxyfile
index ba1638ebb..4e380f138 100644
--- a/tinyusb.Doxyfile
+++ b/tinyusb.Doxyfile
@@ -2010,13 +2010,13 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-PREDEFINED = TUSB_CFG_CONTROLLER_0_MODE=TUSB_MODE_HOST \
- TUSB_CFG_CONTROLLER_1_MODE=TUSB_MODE_NONE \
- TUSB_CFG_HOST_HID_KEYBOARD=1 \
+PREDEFINED = CFG_TUSB_CONTROLLER_0_MODE=TUSB_MODE_HOST \
+ CFG_TUSB_CONTROLLER_1_MODE=TUSB_MODE_NONE \
+ CFG_TUSB_HOST_HID_KEYBOARD=1 \
ATTR_PACKED_STRUCT(x)=x \
- TUSB_CFG_HOST_CDC_RNDIS=1 \
+ CFG_TUSB_HOST_CDC_RNDIS=1 \
ATTR_ALIGNED(x)= \
- TUSB_CFG_OS=TUSB_OS_NONE
+ CFG_TUSB_OS=TUSB_OS_NONE
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
diff --git a/tinyusb/class/cdc/cdc_device.c b/tinyusb/class/cdc/cdc_device.c
index 3dde8a4a9..5ca4c7d31 100644
--- a/tinyusb/class/cdc/cdc_device.c
+++ b/tinyusb/class/cdc/cdc_device.c
@@ -38,7 +38,7 @@
#include "tusb_option.h"
-#if (MODE_DEVICE_SUPPORTED && TUSB_CFG_DEVICE_CDC)
+#if (MODE_DEVICE_SUPPORTED && CFG_TUSB_DEVICE_CDC)
#define _TINY_USB_SOURCE_FILE_
//--------------------------------------------------------------------+
@@ -51,7 +51,7 @@
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM STATIC_VAR cdc_line_coding_t cdcd_line_coding[CONTROLLER_DEVICE_NUMBER];
+CFG_TUSB_ATTR_USBRAM STATIC_VAR cdc_line_coding_t cdcd_line_coding[CONTROLLER_DEVICE_NUMBER];
typedef struct {
uint8_t interface_number;
@@ -66,8 +66,8 @@ typedef struct {
}cdcd_data_t;
// TODO multiple rhport
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4) uint8_t _tmp_rx_buf[64];
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4) uint8_t _tmp_tx_buf[64];
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4) uint8_t _tmp_rx_buf[64];
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4) uint8_t _tmp_tx_buf[64];
#define CFG_TUD_CDC_BUFSIZE 128
diff --git a/tinyusb/class/cdc/cdc_host.c b/tinyusb/class/cdc/cdc_host.c
index 56f36aedb..bd5b5e32c 100644
--- a/tinyusb/class/cdc/cdc_host.c
+++ b/tinyusb/class/cdc/cdc_host.c
@@ -38,7 +38,7 @@
#include "tusb_option.h"
-#if (MODE_HOST_SUPPORTED && TUSB_CFG_HOST_CDC)
+#if (MODE_HOST_SUPPORTED && CFG_TUSB_HOST_CDC)
#define _TINY_USB_SOURCE_FILE_
@@ -55,7 +55,7 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-STATIC_VAR cdch_data_t cdch_data[TUSB_CFG_HOST_DEVICE_MAX]; // TODO to be static
+STATIC_VAR cdch_data_t cdch_data[CFG_TUSB_HOST_DEVICE_MAX]; // TODO to be static
static inline cdc_pipeid_t get_app_pipeid(pipe_handle_t pipe_hdl)
{
@@ -139,7 +139,7 @@ tusb_error_t tuh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length,
//--------------------------------------------------------------------+
void cdch_init(void)
{
- memclr_(cdch_data, sizeof(cdch_data_t)*TUSB_CFG_HOST_DEVICE_MAX);
+ memclr_(cdch_data, sizeof(cdch_data_t)*CFG_TUSB_HOST_DEVICE_MAX);
}
tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length)
diff --git a/tinyusb/class/cdc/cdc_host.h b/tinyusb/class/cdc/cdc_host.h
index f720cb438..77f1e5a78 100644
--- a/tinyusb/class/cdc/cdc_host.h
+++ b/tinyusb/class/cdc/cdc_host.h
@@ -77,27 +77,27 @@ bool tuh_cdc_is_busy(uint8_t dev_addr, cdc_pipeid_t pipeid) ATTR_PURE ATTR_WARN
/** \brief Perform USB OUT transfer to device
* \param[in] dev_addr device address
- * \param[in] p_data Buffer containing data. Must be accessible by USB controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * \param[in] p_data Buffer containing data. Must be accessible by USB controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \param[in] length Number of bytes to be transferred via USB bus
* \retval TUSB_ERROR_NONE on success
* \retval TUSB_ERROR_INTERFACE_IS_BUSY if the interface is already transferring data with device
* \retval TUSB_ERROR_DEVICE_NOT_READY if device is not yet configured (by SET CONFIGURED request)
* \retval TUSB_ERROR_INVALID_PARA if input parameters are not correct
* \note This function is non-blocking and returns immediately. The result of USB transfer will be reported by the
- * interface's callback function. \a p_data must be declared with \ref TUSB_CFG_ATTR_USBRAM.
+ * interface's callback function. \a p_data must be declared with \ref CFG_TUSB_ATTR_USBRAM.
*/
tusb_error_t tuh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length, bool is_notify);
/** \brief Perform USB IN transfer to get data from device
* \param[in] dev_addr device address
- * \param[in] p_buffer Buffer containing received data. Must be accessible by USB controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * \param[in] p_buffer Buffer containing received data. Must be accessible by USB controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \param[in] length Number of bytes to be transferred via USB bus
* \retval TUSB_ERROR_NONE on success
* \retval TUSB_ERROR_INTERFACE_IS_BUSY if the interface is already transferring data with device
* \retval TUSB_ERROR_DEVICE_NOT_READY if device is not yet configured (by SET CONFIGURED request)
* \retval TUSB_ERROR_INVALID_PARA if input parameters are not correct
* \note This function is non-blocking and returns immediately. The result of USB transfer will be reported by the
- * interface's callback function. \a p_data must be declared with \ref TUSB_CFG_ATTR_USBRAM.
+ * interface's callback function. \a p_data must be declared with \ref CFG_TUSB_ATTR_USBRAM.
*/
tusb_error_t tuh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, bool is_notify);
@@ -147,7 +147,7 @@ typedef struct {
} cdch_data_t;
-extern cdch_data_t cdch_data[TUSB_CFG_HOST_DEVICE_MAX]; // TODO consider to move to cdch internal header file
+extern cdch_data_t cdch_data[CFG_TUSB_HOST_DEVICE_MAX]; // TODO consider to move to cdch internal header file
void cdch_init(void);
tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length) ATTR_WARN_UNUSED_RESULT;
diff --git a/tinyusb/class/cdc/cdc_rndis_host.c b/tinyusb/class/cdc/cdc_rndis_host.c
index 7026a3871..62361feb4 100644
--- a/tinyusb/class/cdc/cdc_rndis_host.c
+++ b/tinyusb/class/cdc/cdc_rndis_host.c
@@ -38,7 +38,7 @@
#include "tusb_option.h"
-#if (MODE_HOST_SUPPORTED && TUSB_CFG_HOST_CDC && TUSB_CFG_HOST_CDC_RNDIS)
+#if (MODE_HOST_SUPPORTED && CFG_TUSB_HOST_CDC && CFG_TUSB_HOST_CDC_RNDIS)
#define _TINY_USB_SOURCE_FILE_
@@ -54,10 +54,10 @@
//--------------------------------------------------------------------+
#define RNDIS_MSG_PAYLOAD_MAX (1024*4)
-TUSB_CFG_ATTR_USBRAM static uint8_t msg_notification[TUSB_CFG_HOST_DEVICE_MAX][8];
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4) static uint8_t msg_payload[RNDIS_MSG_PAYLOAD_MAX];
+CFG_TUSB_ATTR_USBRAM static uint8_t msg_notification[CFG_TUSB_HOST_DEVICE_MAX][8];
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4) static uint8_t msg_payload[RNDIS_MSG_PAYLOAD_MAX];
-STATIC_VAR rndish_data_t rndish_data[TUSB_CFG_HOST_DEVICE_MAX];
+STATIC_VAR rndish_data_t rndish_data[CFG_TUSB_HOST_DEVICE_MAX];
// TODO Microsoft requires message length for any get command must be at least 4096 bytes
@@ -102,7 +102,7 @@ static tusb_error_t rndis_body_subtask(void)
OSAL_SUBTASK_BEGIN
- for (relative_addr = 0; relative_addr < TUSB_CFG_HOST_DEVICE_MAX; relative_addr++)
+ for (relative_addr = 0; relative_addr < CFG_TUSB_HOST_DEVICE_MAX; relative_addr++)
{
}
@@ -117,12 +117,12 @@ static tusb_error_t rndis_body_subtask(void)
//--------------------------------------------------------------------+
void rndish_init(void)
{
- memclr_(rndish_data, sizeof(rndish_data_t)*TUSB_CFG_HOST_DEVICE_MAX);
+ memclr_(rndish_data, sizeof(rndish_data_t)*CFG_TUSB_HOST_DEVICE_MAX);
//------------- Task creation -------------//
//------------- semaphore creation for notificaiton pipe -------------//
- for(uint8_t i=0; i<TUSB_CFG_HOST_DEVICE_MAX; i++)
+ for(uint8_t i=0; i<CFG_TUSB_HOST_DEVICE_MAX; i++)
{
rndish_data[i].sem_notification_hdl = osal_semaphore_create( OSAL_SEM_REF(rndish_data[i].semaphore_notification) );
}
diff --git a/tinyusb/class/custom_class_host.c b/tinyusb/class/custom_class_host.c
index 474931cf9..6aca2bfb3 100644
--- a/tinyusb/class/custom_class_host.c
+++ b/tinyusb/class/custom_class_host.c
@@ -38,7 +38,7 @@
#include "tusb_option.h"
-#if (MODE_HOST_SUPPORTED && TUSB_CFG_HOST_CUSTOM_CLASS)
+#if (MODE_HOST_SUPPORTED && CFG_TUSB_HOST_CUSTOM_CLASS)
#define _TINY_USB_SOURCE_FILE_
@@ -55,7 +55,7 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-custom_interface_info_t custom_interface[TUSB_CFG_HOST_DEVICE_MAX];
+custom_interface_info_t custom_interface[CFG_TUSB_HOST_DEVICE_MAX];
static tusb_error_t cush_validate_paras(uint8_t dev_addr, uint16_t vendor_id, uint16_t product_id, void * p_buffer, uint16_t length)
{
@@ -104,7 +104,7 @@ tusb_error_t tusbh_custom_write(uint8_t dev_addr, uint16_t vendor_id, uint16_t p
//--------------------------------------------------------------------+
void cush_init(void)
{
- memclr_(&custom_interface, sizeof(custom_interface_info_t) * TUSB_CFG_HOST_DEVICE_MAX);
+ memclr_(&custom_interface, sizeof(custom_interface_info_t) * CFG_TUSB_HOST_DEVICE_MAX);
}
tusb_error_t cush_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length)
diff --git a/tinyusb/class/hid/hid_device.c b/tinyusb/class/hid/hid_device.c
index 6790ef739..da296260e 100644
--- a/tinyusb/class/hid/hid_device.c
+++ b/tinyusb/class/hid/hid_device.c
@@ -78,7 +78,7 @@ static hidd_class_driver_t const hidd_class_driver[HIDD_NUMBER_OF_SUBCLASS] =
{
// [HID_PROTOCOL_NONE] = for HID Generic
-#if TUSB_CFG_DEVICE_HID_KEYBOARD
+#if CFG_TUSB_DEVICE_HID_KEYBOARD
[HID_PROTOCOL_KEYBOARD] =
{
.p_interface = &keyboardd_data,
@@ -88,7 +88,7 @@ static hidd_class_driver_t const hidd_class_driver[HIDD_NUMBER_OF_SUBCLASS] =
},
#endif
-#if TUSB_CFG_DEVICE_HID_MOUSE
+#if CFG_TUSB_DEVICE_HID_MOUSE
[HID_PROTOCOL_MOUSE] =
{
.p_interface = &moused_data,
@@ -100,12 +100,12 @@ static hidd_class_driver_t const hidd_class_driver[HIDD_NUMBER_OF_SUBCLASS] =
};
// internal buffer for transferring data
-TUSB_CFG_ATTR_USBRAM STATIC_VAR uint8_t m_hid_buffer[ HIDD_BUFFER_SIZE ];
+CFG_TUSB_ATTR_USBRAM STATIC_VAR uint8_t m_hid_buffer[ HIDD_BUFFER_SIZE ];
//--------------------------------------------------------------------+
// KEYBOARD APPLICATION API
//--------------------------------------------------------------------+
-#if TUSB_CFG_DEVICE_HID_KEYBOARD
+#if CFG_TUSB_DEVICE_HID_KEYBOARD
STATIC_VAR hidd_interface_t keyboardd_data;
bool tud_hid_keyboard_busy(uint8_t rhport)
@@ -128,7 +128,7 @@ tusb_error_t tud_hid_keyboard_send(uint8_t rhport, hid_keyboard_report_t const *
//--------------------------------------------------------------------+
// MOUSE APPLICATION API
//--------------------------------------------------------------------+
-#if TUSB_CFG_DEVICE_HID_MOUSE
+#if CFG_TUSB_DEVICE_HID_MOUSE
STATIC_VAR hidd_interface_t moused_data;
bool tud_hid_mouse_is_busy(uint8_t rhport)
diff --git a/tinyusb/class/hid/hid_device.h b/tinyusb/class/hid/hid_device.h
index a816a29ac..b211731e0 100644
--- a/tinyusb/class/hid/hid_device.h
+++ b/tinyusb/class/hid/hid_device.h
@@ -66,7 +66,7 @@ bool tud_hid_keyboard_busy(uint8_t rhport);
/** \brief Submit USB transfer
* \param[in] rhport USB Controller ID
- * \param[in,out] p_report address that is used to store data from device. Must be accessible by usb controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * \param[in,out] p_report address that is used to store data from device. Must be accessible by usb controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \returns \ref tusb_error_t type to indicate success or error condition.
* \retval TUSB_ERROR_NONE on success
* \retval TUSB_ERROR_INTERFACE_IS_BUSY if the interface is already transferring data with device
@@ -96,7 +96,7 @@ void tud_hid_keyboard_cb(uint8_t rhport, tusb_event_t event, uint32_t xferred_by
* via control endpoint.
* \param[in] rhport USB Controller ID
* \param[in] report_type specify which report (INPUT, OUTPUT, FEATURE) that host requests
- * \param[out] pp_report pointer to buffer that application need to update, value must be accessible by USB controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * \param[out] pp_report pointer to buffer that application need to update, value must be accessible by USB controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \param[in] requested_length number of bytes that host requested
* \retval non-zero Actual number of bytes in the response's buffer.
* \retval zero indicates the current request is not supported. Tinyusb device stack will reject the request by
@@ -139,7 +139,7 @@ bool tud_hid_mouse_is_busy(uint8_t rhport);
/** \brief Perform transfer queuing
* \param[in] rhport USB Controller ID
- * \param[in,out] p_report address that is used to store data from device. Must be accessible by usb controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * \param[in,out] p_report address that is used to store data from device. Must be accessible by usb controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \returns \ref tusb_error_t type to indicate success or error condition.
* \retval TUSB_ERROR_NONE on success
* \retval TUSB_ERROR_INTERFACE_IS_BUSY if the interface is already transferring data with device
@@ -169,7 +169,7 @@ void tud_hid_mouse_cb(uint8_t rhport, tusb_event_t event, uint32_t xferred_bytes
* via control endpoint.
* \param[in] rhport USB Controller ID
* \param[in] report_type specify which report (INPUT, OUTPUT, FEATURE) that host requests
- * \param[out] pp_report pointer to buffer that application need to update, value must be accessible by USB controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * \param[out] pp_report pointer to buffer that application need to update, value must be accessible by USB controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \param[in] requested_length number of bytes that host requested
* \retval non-zero Actual number of bytes in the response's buffer.
* \retval zero indicates the current request is not supported. Tinyusb device stack will reject the request by
diff --git a/tinyusb/class/hid/hid_host.c b/tinyusb/class/hid/hid_host.c
index 06e87210b..65bb36b15 100644
--- a/tinyusb/class/hid/hid_host.c
+++ b/tinyusb/class/hid/hid_host.c
@@ -88,7 +88,7 @@ tusb_error_t hidh_interface_get_report(uint8_t dev_addr, void * report, hidh_int
//--------------------------------------------------------------------+
// KEYBOARD
//--------------------------------------------------------------------+
-#if TUSB_CFG_HOST_HID_KEYBOARD
+#if CFG_TUSB_HOST_HID_KEYBOARD
#define EXPAND_KEYCODE_TO_ASCII(keycode, ascii, shift_modified) \
[0][keycode] = ascii,\
@@ -100,7 +100,7 @@ uint8_t const hid_keycode_to_ascii_tbl[2][128] =
HID_KEYCODE_TABLE(EXPAND_KEYCODE_TO_ASCII)
};
-STATIC_VAR hidh_interface_info_t keyboardh_data[TUSB_CFG_HOST_DEVICE_MAX]; // does not have addr0, index = dev_address-1
+STATIC_VAR hidh_interface_info_t keyboardh_data[CFG_TUSB_HOST_DEVICE_MAX]; // does not have addr0, index = dev_address-1
//------------- KEYBOARD PUBLIC API (parameter validation required) -------------//
bool tuh_hid_keyboard_is_mounted(uint8_t dev_addr)
@@ -124,9 +124,9 @@ bool tuh_hid_keyboard_is_busy(uint8_t dev_addr)
//--------------------------------------------------------------------+
// MOUSE
//--------------------------------------------------------------------+
-#if TUSB_CFG_HOST_HID_MOUSE
+#if CFG_TUSB_HOST_HID_MOUSE
-STATIC_VAR hidh_interface_info_t mouseh_data[TUSB_CFG_HOST_DEVICE_MAX]; // does not have addr0, index = dev_address-1
+STATIC_VAR hidh_interface_info_t mouseh_data[CFG_TUSB_HOST_DEVICE_MAX]; // does not have addr0, index = dev_address-1
//------------- Public API -------------//
bool tuh_hid_mouse_is_mounted(uint8_t dev_addr)
@@ -150,11 +150,11 @@ tusb_error_t tuh_hid_mouse_get_report(uint8_t dev_addr, void * report)
//--------------------------------------------------------------------+
// GENERIC
//--------------------------------------------------------------------+
-#if TUSB_CFG_HOST_HID_GENERIC
+#if CFG_TUSB_HOST_HID_GENERIC
//STATIC_ struct {
// hidh_interface_info_t
-//} generic_data[TUSB_CFG_HOST_DEVICE_MAX];
+//} generic_data[CFG_TUSB_HOST_DEVICE_MAX];
#endif
@@ -163,21 +163,21 @@ tusb_error_t tuh_hid_mouse_get_report(uint8_t dev_addr, void * report)
//--------------------------------------------------------------------+
void hidh_init(void)
{
-#if TUSB_CFG_HOST_HID_KEYBOARD
- memclr_(&keyboardh_data, sizeof(hidh_interface_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
+#if CFG_TUSB_HOST_HID_KEYBOARD
+ memclr_(&keyboardh_data, sizeof(hidh_interface_info_t)*CFG_TUSB_HOST_DEVICE_MAX);
#endif
-#if TUSB_CFG_HOST_HID_MOUSE
- memclr_(&mouseh_data, sizeof(hidh_interface_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
+#if CFG_TUSB_HOST_HID_MOUSE
+ memclr_(&mouseh_data, sizeof(hidh_interface_info_t)*CFG_TUSB_HOST_DEVICE_MAX);
#endif
-#if TUSB_CFG_HOST_HID_GENERIC
+#if CFG_TUSB_HOST_HID_GENERIC
hidh_generic_init();
#endif
}
#if 0
-TUSB_CFG_ATTR_USBRAM uint8_t report_descriptor[256];
+CFG_TUSB_ATTR_USBRAM uint8_t report_descriptor[256];
#endif
tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length)
@@ -222,7 +222,7 @@ tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_
if ( HID_SUBCLASS_BOOT == p_interface_desc->bInterfaceSubClass )
{
- #if TUSB_CFG_HOST_HID_KEYBOARD
+ #if CFG_TUSB_HOST_HID_KEYBOARD
if ( HID_PROTOCOL_KEYBOARD == p_interface_desc->bInterfaceProtocol)
{
STASK_ASSERT_ERR ( hidh_interface_open(dev_addr, p_interface_desc->bInterfaceNumber, p_endpoint_desc, &keyboardh_data[dev_addr-1]) );
@@ -230,7 +230,7 @@ tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_
} else
#endif
- #if TUSB_CFG_HOST_HID_MOUSE
+ #if CFG_TUSB_HOST_HID_MOUSE
if ( HID_PROTOCOL_MOUSE == p_interface_desc->bInterfaceProtocol)
{
STASK_ASSERT_ERR ( hidh_interface_open(dev_addr, p_interface_desc->bInterfaceNumber, p_endpoint_desc, &mouseh_data[dev_addr-1]) );
@@ -255,7 +255,7 @@ void hidh_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes
{
(void) xferred_bytes; // TODO may need to use this para later
-#if TUSB_CFG_HOST_HID_KEYBOARD
+#if CFG_TUSB_HOST_HID_KEYBOARD
if ( pipehandle_is_equal(pipe_hdl, keyboardh_data[pipe_hdl.dev_addr-1].pipe_hdl) )
{
tuh_hid_keyboard_isr(pipe_hdl.dev_addr, event);
@@ -263,7 +263,7 @@ void hidh_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes
}
#endif
-#if TUSB_CFG_HOST_HID_MOUSE
+#if CFG_TUSB_HOST_HID_MOUSE
if ( pipehandle_is_equal(pipe_hdl, mouseh_data[pipe_hdl.dev_addr-1].pipe_hdl) )
{
tuh_hid_mouse_isr(pipe_hdl.dev_addr, event);
@@ -271,14 +271,14 @@ void hidh_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes
}
#endif
-#if TUSB_CFG_HOST_HID_GENERIC
+#if CFG_TUSB_HOST_HID_GENERIC
#endif
}
void hidh_close(uint8_t dev_addr)
{
-#if TUSB_CFG_HOST_HID_KEYBOARD
+#if CFG_TUSB_HOST_HID_KEYBOARD
if ( pipehandle_is_valid( keyboardh_data[dev_addr-1].pipe_hdl ) )
{
hidh_interface_close(&keyboardh_data[dev_addr-1]);
@@ -286,7 +286,7 @@ void hidh_close(uint8_t dev_addr)
}
#endif
-#if TUSB_CFG_HOST_HID_MOUSE
+#if CFG_TUSB_HOST_HID_MOUSE
if( pipehandle_is_valid( mouseh_data[dev_addr-1].pipe_hdl ) )
{
hidh_interface_close(&mouseh_data[dev_addr-1]);
@@ -294,7 +294,7 @@ void hidh_close(uint8_t dev_addr)
}
#endif
-#if TUSB_CFG_HOST_HID_GENERIC
+#if CFG_TUSB_HOST_HID_GENERIC
hidh_generic_close(dev_addr);
#endif
}
diff --git a/tinyusb/class/hid/hid_host.h b/tinyusb/class/hid/hid_host.h
index c52f4b6de..b93bcdccb 100644
--- a/tinyusb/class/hid/hid_host.h
+++ b/tinyusb/class/hid/hid_host.h
@@ -80,7 +80,7 @@ bool tuh_hid_keyboard_is_busy(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNU
/** \brief Perform a get report from Keyboard interface
* \param[in] dev_addr device address
- * \param[in,out] p_report address that is used to store data from device. Must be accessible by usb controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * \param[in,out] p_report address that is used to store data from device. Must be accessible by usb controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \returns \ref tusb_error_t type to indicate success or error condition.
* \retval TUSB_ERROR_NONE on success
* \retval TUSB_ERROR_INTERFACE_IS_BUSY if the interface is already transferring data with device
@@ -145,7 +145,7 @@ bool tuh_hid_mouse_is_busy(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED
/** \brief Perform a get report from Mouse interface
* \param[in] dev_addr device address
- * \param[in,out] p_report address that is used to store data from device. Must be accessible by usb controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * \param[in,out] p_report address that is used to store data from device. Must be accessible by usb controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \returns \ref tusb_error_t type to indicate success or error condition.
* \retval TUSB_ERROR_NONE on success
* \retval TUSB_ERROR_INTERFACE_IS_BUSY if the interface is already transferring data with device
diff --git a/tinyusb/class/msc/msc_device.c b/tinyusb/class/msc/msc_device.c
index 3e9008a90..0d7fa4f71 100644
--- a/tinyusb/class/msc/msc_device.c
+++ b/tinyusb/class/msc/msc_device.c
@@ -38,7 +38,7 @@
#include "tusb_option.h"
-#if (MODE_DEVICE_SUPPORTED && TUSB_CFG_DEVICE_MSC)
+#if (MODE_DEVICE_SUPPORTED && CFG_TUSB_DEVICE_MSC)
#define _TINY_USB_SOURCE_FILE_
//--------------------------------------------------------------------+
@@ -64,7 +64,7 @@ typedef struct {
uint8_t scsi_data[64];
ATTR_USB_MIN_ALIGNMENT msc_cbw_t cbw;
-#if defined (__ICCARM__) && (TUSB_CFG_MCU == MCU_LPC11UXX || TUSB_CFG_MCU == MCU_LPC13UXX)
+#if defined (__ICCARM__) && (CFG_TUSB_MCU == MCU_LPC11UXX || CFG_TUSB_MCU == MCU_LPC13UXX)
uint8_t padding1[64-sizeof(msc_cbw_t)]; // IAR cannot align struct's member
#endif
@@ -79,7 +79,7 @@ typedef struct {
uint16_t xferred_len; // numbered of bytes transferred so far in the Data Stage
}mscd_interface_t;
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT STATIC_VAR mscd_interface_t mscd_data;
+CFG_TUSB_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT STATIC_VAR mscd_interface_t mscd_data;
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
diff --git a/tinyusb/class/msc/msc_device.h b/tinyusb/class/msc/msc_device.h
index 8176e7ea6..1d7b11aec 100644
--- a/tinyusb/class/msc/msc_device.h
+++ b/tinyusb/class/msc/msc_device.h
@@ -64,7 +64,7 @@
* \param[in] rhport USB Controller ID
* \param[in] lun Targeted Logical Unit
* \param[out] pp_buffer Pointer to buffer which application need to update with the response data's address.
- * Must be accessible by USB controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * Must be accessible by USB controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \param[in] lba Starting Logical Block Address to be read
* \param[in] block_count Number of requested block
* \retval non-zero Actual number of block that application processed, must be less than or equal to \a \b block_count.
@@ -82,7 +82,7 @@ uint16_t tud_msc_read10_cb (uint8_t rhport, uint8_t lun, void** pp_buffer, uint3
* \param[in] rhport USB Controller ID
* \param[in] lun Targeted Logical Unit
* \param[out] pp_buffer Pointer to buffer which application need to update with the address to hold data from host
- * Must be accessible by USB controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * Must be accessible by USB controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \param[in] lba Starting Logical Block Address to be write
* \param[in] block_count Number of requested block
* \retval non-zero Actual number of block that application can receive and must be less than or equal to \a \b block_count.
diff --git a/tinyusb/class/msc/msc_host.c b/tinyusb/class/msc/msc_host.c
index c0b643076..dcdfa4d53 100644
--- a/tinyusb/class/msc/msc_host.c
+++ b/tinyusb/class/msc/msc_host.c
@@ -38,7 +38,7 @@
#include "tusb_option.h"
-#if MODE_HOST_SUPPORTED & TUSB_CFG_HOST_MSC
+#if MODE_HOST_SUPPORTED & CFG_TUSB_HOST_MSC
#define _TINY_USB_SOURCE_FILE_
@@ -51,13 +51,13 @@
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM STATIC_VAR msch_interface_t msch_data[TUSB_CFG_HOST_DEVICE_MAX];
+CFG_TUSB_ATTR_USBRAM STATIC_VAR msch_interface_t msch_data[CFG_TUSB_HOST_DEVICE_MAX];
//------------- Initalization Data -------------//
static osal_semaphore_t msch_sem_hdl;
// buffer used to read scsi information when mounted, largest response data currently is inquiry
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4) STATIC_VAR uint8_t msch_buffer[sizeof(scsi_inquiry_data_t)];
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4) STATIC_VAR uint8_t msch_buffer[sizeof(scsi_inquiry_data_t)];
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
@@ -288,7 +288,7 @@ tusb_error_t tuh_msc_write10(uint8_t dev_addr, uint8_t lun, void const * p_buffe
//--------------------------------------------------------------------+
void msch_init(void)
{
- memclr_(msch_data, sizeof(msch_interface_t)*TUSB_CFG_HOST_DEVICE_MAX);
+ memclr_(msch_data, sizeof(msch_interface_t)*CFG_TUSB_HOST_DEVICE_MAX);
msch_sem_hdl = osal_semaphore_create(1, 0);
}
diff --git a/tinyusb/class/msc/msc_host.h b/tinyusb/class/msc/msc_host.h
index 049db97ce..dce275fc8 100644
--- a/tinyusb/class/msc/msc_host.h
+++ b/tinyusb/class/msc/msc_host.h
@@ -104,7 +104,7 @@ tusb_error_t tuh_msc_get_capacity(uint8_t dev_addr, uint32_t* p_last_lba, uint32
/** \brief Perform SCSI READ 10 command to read data from MassStorage device
* \param[in] dev_addr device address
* \param[in] lun Targeted Logical Unit
- * \param[out] p_buffer Buffer used to store data read from device. Must be accessible by USB controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * \param[out] p_buffer Buffer used to store data read from device. Must be accessible by USB controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \param[in] lba Starting Logical Block Address to be read
* \param[in] block_count Number of Block to be read
* \retval TUSB_ERROR_NONE on success
@@ -118,7 +118,7 @@ tusb_error_t tuh_msc_read10 (uint8_t dev_addr, uint8_t lun, void * p_buffer, uin
/** \brief Perform SCSI WRITE 10 command to write data to MassStorage device
* \param[in] dev_addr device address
* \param[in] lun Targeted Logical Unit
- * \param[in] p_buffer Buffer containing data. Must be accessible by USB controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * \param[in] p_buffer Buffer containing data. Must be accessible by USB controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \param[in] lba Starting Logical Block Address to be written
* \param[in] block_count Number of Block to be written
* \retval TUSB_ERROR_NONE on success
@@ -132,7 +132,7 @@ tusb_error_t tuh_msc_write10(uint8_t dev_addr, uint8_t lun, void const * p_buffe
/** \brief Perform SCSI REQUEST SENSE command, used to retrieve sense data from MassStorage device
* \param[in] dev_addr device address
* \param[in] lun Targeted Logical Unit
- * \param[in] p_data Buffer to store response's data from device. Must be accessible by USB controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * \param[in] p_data Buffer to store response's data from device. Must be accessible by USB controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \retval TUSB_ERROR_NONE on success
* \retval TUSB_ERROR_INTERFACE_IS_BUSY if the interface is already transferring data with device
* \retval TUSB_ERROR_DEVICE_NOT_READY if device is not yet configured (by SET CONFIGURED request)
diff --git a/tinyusb/common/tusb_compiler.h b/tinyusb/common/tusb_compiler.h
index 8c0e75029..369c3121a 100644
--- a/tinyusb/common/tusb_compiler.h
+++ b/tinyusb/common/tusb_compiler.h
@@ -65,7 +65,7 @@
#endif
// allow debugger to watch any module-wide variables anywhere
-#if TUSB_CFG_DEBUG
+#if CFG_TUSB_DEBUG
#define STATIC_VAR
#else
#define STATIC_VAR static
diff --git a/tinyusb/common/tusb_error.h b/tinyusb/common/tusb_error.h
index 96684ef5f..339f6ced1 100644
--- a/tinyusb/common/tusb_error.h
+++ b/tinyusb/common/tusb_error.h
@@ -100,8 +100,8 @@ typedef enum
TUSB_ERROR_COUNT
}tusb_error_t;
-#if TUSB_CFG_DEBUG
-/// Enum to String for debugging purposes. Only available if \ref TUSB_CFG_DEBUG > 0
+#if CFG_TUSB_DEBUG
+/// Enum to String for debugging purposes. Only available if \ref CFG_TUSB_DEBUG > 0
extern char const* const tusb_strerr[TUSB_ERROR_COUNT];
#endif
diff --git a/tinyusb/common/tusb_fifo.h b/tinyusb/common/tusb_fifo.h
index 8054f315c..217781c9c 100644
--- a/tinyusb/common/tusb_fifo.h
+++ b/tinyusb/common/tusb_fifo.h
@@ -57,7 +57,7 @@
#include "osal/osal.h"
-#if TUSB_CFG_OS == TUSB_OS_NONE
+#if CFG_TUSB_OS == TUSB_OS_NONE
// Since all fifo read/write is done in thread mode, there should be
// no conflict except for osal queue which will be address seperatedly.
// Therefore there may be no need for mutex with internal use of fifo
diff --git a/tinyusb/common/tusb_verify.h b/tinyusb/common/tusb_verify.h
index 516a30a75..4a9ac2d36 100644
--- a/tinyusb/common/tusb_verify.h
+++ b/tinyusb/common/tusb_verify.h
@@ -60,7 +60,7 @@
//--------------------------------------------------------------------+
// VERIFY Helper
//--------------------------------------------------------------------+
-#if TUSB_CFG_DEBUG >= 1
+#if CFG_TUSB_DEBUG >= 1
#define _MESS_ERR(_err) printf("%s: %d: failed, error = %s\n", __PRETTY_FUNCTION__, __LINE__, tusb_strerr[_err])
#define _MESS_FAILED() printf("%s: %d: failed\n", __PRETTY_FUNCTION__, __LINE__)
#else
diff --git a/tinyusb/device/usbd.c b/tinyusb/device/usbd.c
index d18cb258a..23bf971d3 100644
--- a/tinyusb/device/usbd.c
+++ b/tinyusb/device/usbd.c
@@ -76,7 +76,7 @@ typedef struct {
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
usbd_device_info_t usbd_devices[CONTROLLER_DEVICE_NUMBER];
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT uint8_t usbd_enum_buffer[TUSB_CFG_DEVICE_ENUM_BUFFER_SIZE];
+CFG_TUSB_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT uint8_t usbd_enum_buffer[CFG_TUSB_DEVICE_ENUM_BUFFER_SIZE];
static usbd_class_driver_t const usbd_class_drivers[] =
{
@@ -93,7 +93,7 @@ static usbd_class_driver_t const usbd_class_drivers[] =
},
#endif
- #if TUSB_CFG_DEVICE_MSC
+ #if CFG_TUSB_DEVICE_MSC
[TUSB_CLASS_MSC] =
{
.init = mscd_init,
@@ -106,7 +106,7 @@ static usbd_class_driver_t const usbd_class_drivers[] =
},
#endif
- #if TUSB_CFG_DEVICE_CDC
+ #if CFG_TUSB_DEVICE_CDC
[TUSB_CLASS_CDC] =
{
.init = cdcd_init,
@@ -184,8 +184,8 @@ VERIFY_STATIC(sizeof(usbd_task_event_t) <= 12, "size is not correct");
#define TUC_DEVICE_STACKSIZE 150
#endif
-#ifndef TUSB_CFG_OS_TASK_PRIO
-#define TUSB_CFG_OS_TASK_PRIO 0
+#ifndef CFG_TUSB_OS_TASK_PRIO
+#define CFG_TUSB_OS_TASK_PRIO 0
#endif
@@ -200,11 +200,11 @@ static tusb_error_t usbd_main_st(void);
tusb_error_t usbd_init (void)
{
- #if (TUSB_CFG_CONTROLLER_0_MODE & TUSB_MODE_DEVICE)
+ #if (CFG_TUSB_CONTROLLER_0_MODE & TUSB_MODE_DEVICE)
dcd_init(0);
#endif
- #if (TUSB_CFG_CONTROLLER_1_MODE & TUSB_MODE_DEVICE)
+ #if (CFG_TUSB_CONTROLLER_1_MODE & TUSB_MODE_DEVICE)
dcd_init(1);
#endif
@@ -215,7 +215,7 @@ tusb_error_t usbd_init (void)
_usbd_ctrl_sem = osal_semaphore_create(1, 0);
VERIFY(_usbd_q, TUSB_ERROR_OSAL_SEMAPHORE_FAILED);
- osal_task_create(usbd_task, "usbd", TUC_DEVICE_STACKSIZE, NULL, TUSB_CFG_OS_TASK_PRIO);
+ osal_task_create(usbd_task, "usbd", TUC_DEVICE_STACKSIZE, NULL, CFG_TUSB_OS_TASK_PRIO);
//------------- Descriptor Check -------------//
TU_ASSERT(tusbd_descriptor_pointers.p_device != NULL && tusbd_descriptor_pointers.p_configuration != NULL, TUSB_ERROR_DESCRIPTOR_CORRUPTED);
@@ -489,7 +489,7 @@ static uint16_t get_descriptor(uint8_t rhport, tusb_control_request_t const * co
// up to Host's length
len = min16_of(p_request->wLength, len );
- TU_ASSERT( len <= TUSB_CFG_DEVICE_ENUM_BUFFER_SIZE, 0);
+ TU_ASSERT( len <= CFG_TUSB_DEVICE_ENUM_BUFFER_SIZE, 0);
memcpy(usbd_enum_buffer, desc_data, len);
(*pp_buffer) = usbd_enum_buffer;
diff --git a/tinyusb/device/usbd.h b/tinyusb/device/usbd.h
index a2559d880..3f8fc1be9 100644
--- a/tinyusb/device/usbd.h
+++ b/tinyusb/device/usbd.h
@@ -63,8 +63,8 @@ typedef struct {
uint8_t const * p_configuration; ///< pointer to the whole configuration descriptor, starting by \ref tusb_desc_configuration_t
uint8_t const** p_string_arr; ///< a array of pointers to string descriptors
- uint8_t const * p_hid_keyboard_report; ///< pointer to HID report descriptor of Keybaord interface. Only needed if TUSB_CFG_DEVICE_HID_KEYBOARD is enabled
- uint8_t const * p_hid_mouse_report; ///< pointer to HID report descriptor of Mouse interface. Only needed if TUSB_CFG_DEVICE_HID_MOUSE is enabled
+ uint8_t const * p_hid_keyboard_report; ///< pointer to HID report descriptor of Keybaord interface. Only needed if CFG_TUSB_DEVICE_HID_KEYBOARD is enabled
+ uint8_t const * p_hid_mouse_report; ///< pointer to HID report descriptor of Mouse interface. Only needed if CFG_TUSB_DEVICE_HID_MOUSE is enabled
}tusbd_descriptor_pointer_t;
// define by application
diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c
index 0686748f4..f1b2c7f92 100644
--- a/tinyusb/host/ehci/ehci.c
+++ b/tinyusb/host/ehci/ehci.c
@@ -38,7 +38,7 @@
#include "common/tusb_common.h"
-#if MODE_HOST_SUPPORTED && (TUSB_CFG_MCU == MCU_LPC43XX || TUSB_CFG_MCU == MCU_LPC18XX)
+#if MODE_HOST_SUPPORTED && (CFG_TUSB_MCU == MCU_LPC43XX || CFG_TUSB_MCU == MCU_LPC18XX)
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
@@ -57,20 +57,20 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM STATIC_VAR ehci_data_t ehci_data;
+CFG_TUSB_ATTR_USBRAM STATIC_VAR ehci_data_t ehci_data;
#if EHCI_PERIODIC_LIST
- #if (TUSB_CFG_CONTROLLER_0_MODE & TUSB_MODE_HOST)
- TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4096) STATIC_VAR ehci_link_t period_frame_list0[EHCI_FRAMELIST_SIZE];
+ #if (CFG_TUSB_CONTROLLER_0_MODE & TUSB_MODE_HOST)
+ CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4096) STATIC_VAR ehci_link_t period_frame_list0[EHCI_FRAMELIST_SIZE];
#ifndef __ICCARM__ // IAR cannot able to determine the alignment with datalignment pragma
VERIFY_STATIC( ALIGN_OF(period_frame_list0) == 4096, "Period Framelist must be 4k alginment"); // validation
#endif
#endif
- #if (TUSB_CFG_CONTROLLER_1_MODE & TUSB_MODE_HOST)
- TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4096) STATIC_VAR ehci_link_t period_frame_list1[EHCI_FRAMELIST_SIZE];
+ #if (CFG_TUSB_CONTROLLER_1_MODE & TUSB_MODE_HOST)
+ CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4096) STATIC_VAR ehci_link_t period_frame_list1[EHCI_FRAMELIST_SIZE];
#ifndef __ICCARM__ // IAR cannot able to determine the alignment with datalignment pragma
VERIFY_STATIC( ALIGN_OF(period_frame_list1) == 4096, "Period Framelist must be 4k alginment"); // validation
@@ -133,11 +133,11 @@ tusb_error_t hcd_init(void)
//------------- Data Structure init -------------//
memclr_(&ehci_data, sizeof(ehci_data_t));
- #if (TUSB_CFG_CONTROLLER_0_MODE & TUSB_MODE_HOST)
+ #if (CFG_TUSB_CONTROLLER_0_MODE & TUSB_MODE_HOST)
ASSERT_ERR (hcd_controller_init(0));
#endif
- #if (TUSB_CFG_CONTROLLER_1_MODE & TUSB_MODE_HOST)
+ #if (CFG_TUSB_CONTROLLER_1_MODE & TUSB_MODE_HOST)
ASSERT_ERR (hcd_controller_init(1));
#endif
@@ -511,7 +511,7 @@ static void async_advance_isr(ehci_qhd_t * const async_head)
usbh_devices[0].state = TUSB_DEVICE_STATE_UNPLUG;
}
- for(uint8_t relative_dev_addr=0; relative_dev_addr < TUSB_CFG_HOST_DEVICE_MAX; relative_dev_addr++)
+ for(uint8_t relative_dev_addr=0; relative_dev_addr < CFG_TUSB_HOST_DEVICE_MAX; relative_dev_addr++)
{
// check if control endpoint is removing
ehci_qhd_t *p_control_qhd = &ehci_data.device[relative_dev_addr].control.qhd;
@@ -592,7 +592,7 @@ static void async_list_xfer_complete_isr(ehci_qhd_t * const async_head)
}
p_qhd = qhd_next(p_qhd);
max_loop++;
- }while(p_qhd != async_head && max_loop < HCD_MAX_ENDPOINT*TUSB_CFG_HOST_DEVICE_MAX); // async list traversal, stop if loop around
+ }while(p_qhd != async_head && max_loop < HCD_MAX_ENDPOINT*CFG_TUSB_HOST_DEVICE_MAX); // async list traversal, stop if loop around
// TODO abstract max loop guard for async
}
@@ -606,7 +606,7 @@ static void period_list_xfer_complete_isr(uint8_t hostid, uint8_t interval_ms)
// TODO abstract max loop guard for period
while( !next_item.terminate &&
!(interval_ms > 1 && period_1ms_addr == align32(next_item.address)) &&
- max_loop < (HCD_MAX_ENDPOINT + EHCI_MAX_ITD + EHCI_MAX_SITD)*TUSB_CFG_HOST_DEVICE_MAX)
+ max_loop < (HCD_MAX_ENDPOINT + EHCI_MAX_ITD + EHCI_MAX_SITD)*CFG_TUSB_HOST_DEVICE_MAX)
{
switch ( next_item.type )
{
@@ -691,7 +691,7 @@ static void xfer_error_isr(uint8_t hostid)
qhd_xfer_error_isr( p_qhd );
p_qhd = qhd_next(p_qhd);
max_loop++;
- }while(p_qhd != async_head && max_loop < HCD_MAX_ENDPOINT*TUSB_CFG_HOST_DEVICE_MAX); // async list traversal, stop if loop around
+ }while(p_qhd != async_head && max_loop < HCD_MAX_ENDPOINT*CFG_TUSB_HOST_DEVICE_MAX); // async list traversal, stop if loop around
#if EHCI_PERIODIC_LIST
//------------- TODO refractor period list -------------//
@@ -704,7 +704,7 @@ static void xfer_error_isr(uint8_t hostid)
// TODO abstract max loop guard for period
while( !next_item.terminate &&
!(interval_ms > 1 && period_1ms_addr == align32(next_item.address)) &&
- period_max_loop < (HCD_MAX_ENDPOINT + EHCI_MAX_ITD + EHCI_MAX_SITD)*TUSB_CFG_HOST_DEVICE_MAX)
+ period_max_loop < (HCD_MAX_ENDPOINT + EHCI_MAX_ITD + EHCI_MAX_SITD)*CFG_TUSB_HOST_DEVICE_MAX)
{
switch ( next_item.type )
{
@@ -794,12 +794,12 @@ static inline ehci_link_t* get_period_frame_list(uint8_t hostid)
{
switch(hostid)
{
-#if (TUSB_CFG_CONTROLLER_0_MODE & TUSB_MODE_HOST)
+#if (CFG_TUSB_CONTROLLER_0_MODE & TUSB_MODE_HOST)
case 0:
return period_frame_list0;
#endif
-#if (TUSB_CFG_CONTROLLER_1_MODE & TUSB_MODE_HOST)
+#if (CFG_TUSB_CONTROLLER_1_MODE & TUSB_MODE_HOST)
case 1:
return period_frame_list1;
#endif
@@ -811,7 +811,7 @@ static inline ehci_link_t* get_period_frame_list(uint8_t hostid)
static inline uint8_t hostid_to_data_idx(uint8_t hostid)
{
- #if (CONTROLLER_HOST_NUMBER == 1) && (TUSB_CFG_CONTROLLER_1_MODE & TUSB_MODE_HOST)
+ #if (CONTROLLER_HOST_NUMBER == 1) && (CFG_TUSB_CONTROLLER_1_MODE & TUSB_MODE_HOST)
(void) hostid;
return 0;
#else
diff --git a/tinyusb/host/ehci/ehci.h b/tinyusb/host/ehci/ehci.h
index 5b1cc7987..250023ee5 100644
--- a/tinyusb/host/ehci/ehci.h
+++ b/tinyusb/host/ehci/ehci.h
@@ -471,7 +471,7 @@ typedef struct {
ehci_qtd_t qtd[HCD_MAX_XFER] ATTR_ALIGNED(32) ; ///< Queue Element Transfer Pool
// ehci_itd_t itd[EHCI_MAX_ITD] ; ///< Iso Transfer Pool
// ehci_sitd_t sitd[EHCI_MAX_SITD] ; ///< Split (FS) Isochronous Transfer Pool
- }device[TUSB_CFG_HOST_DEVICE_MAX];
+ }device[CFG_TUSB_HOST_DEVICE_MAX];
}ehci_data_t;
#ifdef __cplusplus
diff --git a/tinyusb/host/hcd.h b/tinyusb/host/hcd.h
index a7f412cbf..b9f6a1ff7 100644
--- a/tinyusb/host/hcd.h
+++ b/tinyusb/host/hcd.h
@@ -52,8 +52,8 @@
#if MODE_HOST_SUPPORTED
// Max number of endpoints per device
enum {
- HCD_MAX_ENDPOINT = TUSB_CFG_HOST_HUB + TUSB_CFG_HOST_HID_KEYBOARD + TUSB_CFG_HOST_HID_MOUSE + TUSB_CFG_HOST_HID_GENERIC +
- TUSB_CFG_HOST_MSC*2 + TUSB_CFG_HOST_CDC*3,
+ HCD_MAX_ENDPOINT = CFG_TUSB_HOST_HUB + CFG_TUSB_HOST_HID_KEYBOARD + CFG_TUSB_HOST_HID_MOUSE + CFG_TUSB_HOST_HID_GENERIC +
+ CFG_TUSB_HOST_MSC*2 + CFG_TUSB_HOST_CDC*3,
HCD_MAX_XFER = HCD_MAX_ENDPOINT*2,
};
diff --git a/tinyusb/host/hub.c b/tinyusb/host/hub.c
index 9b4f03634..063cef61a 100644
--- a/tinyusb/host/hub.c
+++ b/tinyusb/host/hub.c
@@ -38,7 +38,7 @@
#include "tusb_option.h"
-#if (MODE_HOST_SUPPORTED && TUSB_CFG_HOST_HUB)
+#if (MODE_HOST_SUPPORTED && CFG_TUSB_HOST_HUB)
#define _TINY_USB_SOURCE_FILE_
@@ -58,8 +58,8 @@ typedef struct {
uint8_t status_change; // data from status change interrupt endpoint
}usbh_hub_t;
-TUSB_CFG_ATTR_USBRAM STATIC_VAR usbh_hub_t hub_data[TUSB_CFG_HOST_DEVICE_MAX];
-ATTR_ALIGNED(4) TUSB_CFG_ATTR_USBRAM STATIC_VAR uint8_t hub_enum_buffer[sizeof(descriptor_hub_desc_t)];
+CFG_TUSB_ATTR_USBRAM STATIC_VAR usbh_hub_t hub_data[CFG_TUSB_HOST_DEVICE_MAX];
+ATTR_ALIGNED(4) CFG_TUSB_ATTR_USBRAM STATIC_VAR uint8_t hub_enum_buffer[sizeof(descriptor_hub_desc_t)];
//OSAL_SEM_DEF(hub_enum_semaphore);
//static osal_semaphore_handle_t hub_enum_sem_hdl;
@@ -152,7 +152,7 @@ tusb_speed_t hub_port_get_speed(void)
//--------------------------------------------------------------------+
void hub_init(void)
{
- memclr_(hub_data, TUSB_CFG_HOST_DEVICE_MAX*sizeof(usbh_hub_t));
+ memclr_(hub_data, CFG_TUSB_HOST_DEVICE_MAX*sizeof(usbh_hub_t));
// hub_enum_sem_hdl = osal_semaphore_create( OSAL_SEM_REF(hub_enum_semaphore) );
}
diff --git a/tinyusb/host/ohci/ohci.c b/tinyusb/host/ohci/ohci.c
index 435d2d8ff..2d1b70666 100644
--- a/tinyusb/host/ohci/ohci.c
+++ b/tinyusb/host/ohci/ohci.c
@@ -38,7 +38,7 @@
#include <common/tusb_common.h>
-#if MODE_HOST_SUPPORTED && (TUSB_CFG_MCU == MCU_LPC175X_6X)
+#if MODE_HOST_SUPPORTED && (CFG_TUSB_MCU == MCU_LPC175X_6X)
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
@@ -143,7 +143,7 @@ enum {
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(256) STATIC_VAR ohci_data_t ohci_data;
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(256) STATIC_VAR ohci_data_t ohci_data;
static ohci_ed_t * const p_ed_head[] =
{
@@ -384,7 +384,7 @@ static inline ohci_ed_t * ed_find_free(uint8_t dev_addr)
static ohci_ed_t * ed_list_find_previous(ohci_ed_t const * p_head, ohci_ed_t const * p_ed)
{
- uint32_t max_loop = HCD_MAX_ENDPOINT*TUSB_CFG_HOST_DEVICE_MAX;
+ uint32_t max_loop = HCD_MAX_ENDPOINT*CFG_TUSB_HOST_DEVICE_MAX;
ohci_ed_t const * p_prev = p_head;
@@ -608,7 +608,7 @@ static inline uint32_t gtd_xfer_byte_left(uint32_t buffer_end, uint32_t current_
static void done_queue_isr(uint8_t hostid)
{
- uint8_t max_loop = (TUSB_CFG_HOST_DEVICE_MAX+1)*(HCD_MAX_XFER+OHCI_MAX_ITD);
+ uint8_t max_loop = (CFG_TUSB_HOST_DEVICE_MAX+1)*(HCD_MAX_XFER+OHCI_MAX_ITD);
// done head is written in reversed order of completion --> need to reverse the done queue first
ohci_td_item_t* td_head = list_reverse ( (ohci_td_item_t*) align16(ohci_data.hcca.done_head) );
diff --git a/tinyusb/host/ohci/ohci.h b/tinyusb/host/ohci/ohci.h
index 96ee6f90c..f49d85261 100644
--- a/tinyusb/host/ohci/ohci.h
+++ b/tinyusb/host/ohci/ohci.h
@@ -191,13 +191,13 @@ typedef struct ATTR_ALIGNED(256) {
struct {
ohci_ed_t ed;
ohci_gtd_t gtd[3]; // setup, data, status
- }control[TUSB_CFG_HOST_DEVICE_MAX+1];
+ }control[CFG_TUSB_HOST_DEVICE_MAX+1];
struct {
// ochi_itd_t itd[OHCI_MAX_ITD]; // itd requires alignment of 32
ohci_ed_t ed[HCD_MAX_ENDPOINT];
ohci_gtd_t gtd[HCD_MAX_XFER];
- }device[TUSB_CFG_HOST_DEVICE_MAX];
+ }device[CFG_TUSB_HOST_DEVICE_MAX];
} ohci_data_t;
diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c
index bb7300596..6e94ccd4e 100644
--- a/tinyusb/host/usbh.c
+++ b/tinyusb/host/usbh.c
@@ -42,8 +42,8 @@
#define _TINY_USB_SOURCE_FILE_
-#ifndef TUSB_CFG_OS_TASK_PRIO
-#define TUSB_CFG_OS_TASK_PRIO 0
+#ifndef CFG_TUSB_OS_TASK_PRIO
+#define CFG_TUSB_OS_TASK_PRIO 0
#endif
//--------------------------------------------------------------------+
@@ -67,7 +67,7 @@ static host_class_driver_t const usbh_class_drivers[] =
},
#endif
- #if TUSB_CFG_HOST_CDC
+ #if CFG_TUSB_HOST_CDC
[TUSB_CLASS_CDC] = {
.init = cdch_init,
.open_subtask = cdch_open_subtask,
@@ -76,7 +76,7 @@ static host_class_driver_t const usbh_class_drivers[] =
},
#endif
- #if TUSB_CFG_HOST_MSC
+ #if CFG_TUSB_HOST_MSC
[TUSB_CLASS_MSC] = {
.init = msch_init,
.open_subtask = msch_open_subtask,
@@ -85,7 +85,7 @@ static host_class_driver_t const usbh_class_drivers[] =
},
#endif
- #if TUSB_CFG_HOST_HUB
+ #if CFG_TUSB_HOST_HUB
[TUSB_CLASS_HUB] = {
.init = hub_init,
.open_subtask = hub_open_subtask,
@@ -94,7 +94,7 @@ static host_class_driver_t const usbh_class_drivers[] =
},
#endif
- #if TUSB_CFG_HOST_CUSTOM_CLASS
+ #if CFG_TUSB_HOST_CUSTOM_CLASS
[TUSB_CLASS_MAPPED_INDEX_END-1] = {
.init = cush_init,
.open_subtask = cush_open_subtask,
@@ -109,13 +109,13 @@ enum { USBH_CLASS_DRIVER_COUNT = sizeof(usbh_class_drivers) / sizeof(host_class_
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1]; // including zero-address
+CFG_TUSB_ATTR_USBRAM usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1]; // including zero-address
//------------- Enumeration Task Data -------------/
enum { ENUM_QUEUE_DEPTH = 16 };
STATIC_VAR osal_queue_t enum_queue_hdl;
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4) STATIC_VAR uint8_t enum_data_buffer[TUSB_CFG_HOST_ENUM_BUFFER_SIZE];
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4) STATIC_VAR uint8_t enum_data_buffer[CFG_TUSB_HOST_ENUM_BUFFER_SIZE];
//------------- Reporter Task Data -------------//
@@ -128,7 +128,7 @@ static inline uint8_t get_configure_number_for_device(tusb_desc_device_t* dev_de
//--------------------------------------------------------------------+
tusb_device_state_t tuh_device_get_state (uint8_t const dev_addr)
{
- TU_ASSERT( dev_addr <= TUSB_CFG_HOST_DEVICE_MAX, TUSB_DEVICE_STATE_INVALID_PARAMETER);
+ TU_ASSERT( dev_addr <= CFG_TUSB_HOST_DEVICE_MAX, TUSB_DEVICE_STATE_INVALID_PARAMETER);
return (tusb_device_state_t) usbh_devices[dev_addr].state;
}
@@ -142,7 +142,7 @@ uint32_t tuh_device_get_mounted_class_flag(uint8_t dev_addr)
//--------------------------------------------------------------------+
tusb_error_t usbh_init(void)
{
- memclr_(usbh_devices, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1));
+ memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
ASSERT_ERR( hcd_init() );
@@ -150,10 +150,10 @@ tusb_error_t usbh_init(void)
enum_queue_hdl = osal_queue_create( ENUM_QUEUE_DEPTH, sizeof(uint32_t) );
TU_ASSERT(enum_queue_hdl, TUSB_ERROR_OSAL_QUEUE_FAILED);
- osal_task_create(usbh_enumeration_task, "usbh", 200, NULL, TUSB_CFG_OS_TASK_PRIO);
+ osal_task_create(usbh_enumeration_task, "usbh", 200, NULL, CFG_TUSB_OS_TASK_PRIO);
//------------- Semaphore, Mutex for Control Pipe -------------//
- for(uint8_t i=0; i<TUSB_CFG_HOST_DEVICE_MAX+1; i++) // including address zero
+ for(uint8_t i=0; i<CFG_TUSB_HOST_DEVICE_MAX+1; i++) // including address zero
{
usbh_device_info_t * const p_device = &usbh_devices[i];
@@ -293,7 +293,7 @@ static void usbh_device_unplugged(uint8_t hostid, uint8_t hub_addr, uint8_t hub_
{
bool is_found = false;
//------------- find the all devices (star-network) under port that is unplugged -------------//
- for (uint8_t dev_addr = 0; dev_addr <= TUSB_CFG_HOST_DEVICE_MAX; dev_addr ++)
+ for (uint8_t dev_addr = 0; dev_addr <= CFG_TUSB_HOST_DEVICE_MAX; dev_addr ++)
{
if (usbh_devices[dev_addr].core_id == hostid &&
(hub_addr == 0 || usbh_devices[dev_addr].hub_addr == hub_addr) && // hub_addr == 0 & hub_port == 0 means roothub
@@ -401,7 +401,7 @@ tusb_error_t enumeration_body_subtask(void)
STASK_RETURN(TUSB_ERROR_NONE); // restart task
}
}
- #if TUSB_CFG_HOST_HUB
+ #if CFG_TUSB_HOST_HUB
//------------- connected/disconnected via hub -------------//
else
{
@@ -462,7 +462,7 @@ tusb_error_t enumeration_body_subtask(void)
hcd_port_reset( usbh_devices[0].core_id ); // reset port after 8 byte descriptor
osal_task_delay(RESET_DELAY);
}
- #if TUSB_CFG_HOST_HUB
+ #if CFG_TUSB_HOST_HUB
else
{ // connected via a hub
STASK_ASSERT_ERR_HDLR(error, hub_status_pipe_queue( usbh_devices[0].hub_addr) ); // TODO hub refractor
@@ -479,7 +479,7 @@ tusb_error_t enumeration_body_subtask(void)
//------------- Set new address -------------//
new_addr = get_new_address();
- STASK_ASSERT(new_addr <= TUSB_CFG_HOST_DEVICE_MAX); // TODO notify application we reach max devices
+ STASK_ASSERT(new_addr <= CFG_TUSB_HOST_DEVICE_MAX); // TODO notify application we reach max devices
STASK_INVOKE(
usbh_control_xfer_subtask( 0, bm_request_type(TUSB_DIR_OUT, TUSB_REQ_TYPE_STANDARD, TUSB_REQ_RCPT_DEVICE),
@@ -527,14 +527,14 @@ tusb_error_t enumeration_body_subtask(void)
error
);
STASK_ASSERT_ERR(error);
- STASK_ASSERT_HDLR( TUSB_CFG_HOST_ENUM_BUFFER_SIZE >= ((tusb_desc_configuration_t*)enum_data_buffer)->wTotalLength,
+ STASK_ASSERT_HDLR( CFG_TUSB_HOST_ENUM_BUFFER_SIZE >= ((tusb_desc_configuration_t*)enum_data_buffer)->wTotalLength,
tuh_device_mount_failed_cb(TUSB_ERROR_USBH_MOUNT_CONFIG_DESC_TOO_LONG, NULL) );
//------------- Get full configuration descriptor -------------//
STASK_INVOKE(
usbh_control_xfer_subtask( new_addr, bm_request_type(TUSB_DIR_IN, TUSB_REQ_TYPE_STANDARD, TUSB_REQ_RCPT_DEVICE),
TUSB_REQ_GET_DESCRIPTOR, (TUSB_DESC_CONFIGURATION << 8) | (configure_selected - 1), 0,
- TUSB_CFG_HOST_ENUM_BUFFER_SIZE, enum_data_buffer ),
+ CFG_TUSB_HOST_ENUM_BUFFER_SIZE, enum_data_buffer ),
error
);
STASK_ASSERT_ERR(error);
@@ -618,7 +618,7 @@ tusb_error_t enumeration_body_subtask(void)
static inline uint8_t get_new_address(void)
{
uint8_t addr;
- for (addr=1; addr <= TUSB_CFG_HOST_DEVICE_MAX; addr++)
+ for (addr=1; addr <= CFG_TUSB_HOST_DEVICE_MAX; addr++)
{
if (usbh_devices[addr].state == TUSB_DEVICE_STATE_UNPLUG)
break;
diff --git a/tinyusb/host/usbh_hcd.h b/tinyusb/host/usbh_hcd.h
index ac967332e..1c2c4ad0b 100644
--- a/tinyusb/host/usbh_hcd.h
+++ b/tinyusb/host/usbh_hcd.h
@@ -96,7 +96,7 @@ typedef struct {
} control;
} usbh_device_info_t;
-extern usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1]; // including zero-address
+extern usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1]; // including zero-address
//--------------------------------------------------------------------+
// callback from HCD ISR
diff --git a/tinyusb/osal/osal.c b/tinyusb/osal/osal.c
index 68bafa3ea..6bf799d59 100644
--- a/tinyusb/osal/osal.c
+++ b/tinyusb/osal/osal.c
@@ -43,7 +43,7 @@
//--------------------------------------------------------------------+
// TICK API
//--------------------------------------------------------------------+
-#if TUSB_CFG_OS == TUSB_OS_FREERTOS
+#if CFG_TUSB_OS == TUSB_OS_FREERTOS
uint32_t tusb_hal_millis(void)
{
diff --git a/tinyusb/osal/osal.h b/tinyusb/osal/osal.h
index cd165aa3e..f87423d18 100644
--- a/tinyusb/osal/osal.h
+++ b/tinyusb/osal/osal.h
@@ -47,7 +47,7 @@
* @{ */
/** \defgroup group_supported_os Supported RTOS
- * \brief \ref TUSB_CFG_OS must be defined to one of these
+ * \brief \ref CFG_TUSB_OS must be defined to one of these
* @{ */
#define TUSB_OS_NONE 1 ///< No RTOS is used
#define TUSB_OS_FREERTOS 2 ///< FreeRTOS is used
@@ -64,14 +64,14 @@ enum
};
-#if TUSB_CFG_OS == TUSB_OS_NONE
+#if CFG_TUSB_OS == TUSB_OS_NONE
#include "osal_none.h"
#else
- #if TUSB_CFG_OS == TUSB_OS_FREERTOS
+ #if CFG_TUSB_OS == TUSB_OS_FREERTOS
#include "osal_freeRTOS.h"
#else
- #error TUSB_CFG_OS is not defined or OS is not supported yet
+ #error CFG_TUSB_OS is not defined or OS is not supported yet
#endif
#define OSAL_TASK_BEGIN while(1) {
diff --git a/tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c b/tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c
index 082fc40e3..852b67eef 100644
--- a/tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c
+++ b/tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c
@@ -528,6 +528,7 @@ void USBD_IRQHandler(void)
// SOF interrupt
if ( int_status & USBD_INTEN_SOF_Msk )
{
+#if 0
// FIXME Errata 104 The EPDATA event might not be generated, and the related update of EPDATASTATUS does not occur.
// There is no way for software to tell if a xfer is complete or not.
// Walkaround: we will asssume an non-control IN transfer is always complete after 10 frames
@@ -559,6 +560,7 @@ void USBD_IRQHandler(void)
}
}
}
+#endif
dcd_bus_event(0, USBD_BUS_EVENT_SOF);
}
diff --git a/tinyusb/portable/nxp/lpc11xx_lpc13xx/dcd_lpc_11uxx_13uxx.c b/tinyusb/portable/nxp/lpc11xx_lpc13xx/dcd_lpc_11uxx_13uxx.c
index 140438ce0..4fecda490 100644
--- a/tinyusb/portable/nxp/lpc11xx_lpc13xx/dcd_lpc_11uxx_13uxx.c
+++ b/tinyusb/portable/nxp/lpc11xx_lpc13xx/dcd_lpc_11uxx_13uxx.c
@@ -38,7 +38,7 @@
#include "tusb_option.h"
-#if MODE_DEVICE_SUPPORTED && (TUSB_CFG_MCU == MCU_LPC11UXX || TUSB_CFG_MCU == MCU_LPC13UXX)
+#if MODE_DEVICE_SUPPORTED && (CFG_TUSB_MCU == MCU_LPC11UXX || CFG_TUSB_MCU == MCU_LPC13UXX)
#define _TINY_USB_SOURCE_FILE_
@@ -63,7 +63,7 @@
#define DCD_11U_13U_QHD_COUNT 10
enum {
- DCD_11U_13U_MAX_BYTE_PER_TD = (TUSB_CFG_MCU == MCU_LPC11UXX ? 64 : 1023)
+ DCD_11U_13U_MAX_BYTE_PER_TD = (CFG_TUSB_MCU == MCU_LPC11UXX ? 64 : 1023)
};
#ifdef __CC_ARM
@@ -142,11 +142,11 @@ typedef struct {
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-// TUSB_CFG_ATTR_USBRAM must have ATTR_ALIGNED(64) for lpc11u & lpc13u
+// CFG_TUSB_ATTR_USBRAM must have ATTR_ALIGNED(64) for lpc11u & lpc13u
#ifdef __ICCARM__
-ATTR_ALIGNED(256) TUSB_CFG_ATTR_USBRAM // for IAR the first ATTR_ALIGNED takes effect
+ATTR_ALIGNED(256) CFG_TUSB_ATTR_USBRAM // for IAR the first ATTR_ALIGNED takes effect
#else
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(256) // GCC & Keil the last ATTR_ALIGNED takes effect
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(256) // GCC & Keil the last ATTR_ALIGNED takes effect
#endif
STATIC_VAR dcd_11u_13u_data_t dcd_data;
diff --git a/tinyusb/portable/nxp/lpc17xx/dcd_lpc175x_6x.c b/tinyusb/portable/nxp/lpc17xx/dcd_lpc175x_6x.c
index 619aa6b21..73645631e 100644
--- a/tinyusb/portable/nxp/lpc17xx/dcd_lpc175x_6x.c
+++ b/tinyusb/portable/nxp/lpc17xx/dcd_lpc175x_6x.c
@@ -38,7 +38,7 @@
#include "tusb_option.h"
-#if MODE_DEVICE_SUPPORTED && (TUSB_CFG_MCU == MCU_LPC175X_6X)
+#if MODE_DEVICE_SUPPORTED && (CFG_TUSB_MCU == MCU_LPC175X_6X)
#define _TINY_USB_SOURCE_FILE_
//--------------------------------------------------------------------+
@@ -68,7 +68,7 @@ typedef struct {
}dcd_data_t;
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(128) STATIC_VAR dcd_data_t dcd_data;
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(128) STATIC_VAR dcd_data_t dcd_data;
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
@@ -128,8 +128,8 @@ bool dcd_init(uint8_t rhport)
//------------- user manual 11.13 usb device controller initialization -------------// LPC_USB->USBEpInd = 0;
// step 6 : set up control endpoint
- edpt_set_max_packet_size(0, TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE);
- edpt_set_max_packet_size(1, TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE);
+ edpt_set_max_packet_size(0, CFG_TUSB_DEVICE_CONTROL_ENDOINT_SIZE);
+ edpt_set_max_packet_size(1, CFG_TUSB_DEVICE_CONTROL_ENDOINT_SIZE);
bus_reset();
@@ -312,7 +312,7 @@ static inline uint16_t length_byte2dword(uint16_t length_in_bytes)
static tusb_error_t pipe_control_xfer(uint8_t ep_id, uint8_t* p_buffer, uint16_t length)
{
- uint16_t const packet_len = min16_of(length, TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE);
+ uint16_t const packet_len = min16_of(length, CFG_TUSB_DEVICE_CONTROL_ENDOINT_SIZE);
if (ep_id)
{
diff --git a/tinyusb/portable/nxp/lpc17xx/hal_lpc175x_6x.c b/tinyusb/portable/nxp/lpc17xx/hal_lpc175x_6x.c
index ab609dd4f..4ed5c544c 100644
--- a/tinyusb/portable/nxp/lpc17xx/hal_lpc175x_6x.c
+++ b/tinyusb/portable/nxp/lpc17xx/hal_lpc175x_6x.c
@@ -37,7 +37,7 @@
/**************************************************************************/
#include "common/tusb_common.h"
-#if TUSB_CFG_MCU == MCU_LPC175X_6X
+#if CFG_TUSB_MCU == MCU_LPC175X_6X
#include "hal_usb.h"
diff --git a/tinyusb/portable/nxp/lpc43xx_lpc18xx/dcd_lpc43xx.c b/tinyusb/portable/nxp/lpc43xx_lpc18xx/dcd_lpc43xx.c
index 7fffd99f1..df572761a 100644
--- a/tinyusb/portable/nxp/lpc43xx_lpc18xx/dcd_lpc43xx.c
+++ b/tinyusb/portable/nxp/lpc43xx_lpc18xx/dcd_lpc43xx.c
@@ -38,7 +38,7 @@
#include "tusb_option.h"
-#if MODE_DEVICE_SUPPORTED && TUSB_CFG_MCU == MCU_LPC43XX
+#if MODE_DEVICE_SUPPORTED && CFG_TUSB_MCU == MCU_LPC43XX
//--------------------------------------------------------------------+
// INCLUDE
@@ -70,12 +70,12 @@ typedef struct {
extern ATTR_WEAK dcd_data_t dcd_data0;
extern ATTR_WEAK dcd_data_t dcd_data1;
-#if (TUSB_CFG_CONTROLLER_0_MODE & TUSB_MODE_DEVICE)
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(2048) STATIC_VAR dcd_data_t dcd_data0;
+#if (CFG_TUSB_CONTROLLER_0_MODE & TUSB_MODE_DEVICE)
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(2048) STATIC_VAR dcd_data_t dcd_data0;
#endif
-#if (TUSB_CFG_CONTROLLER_1_MODE & TUSB_MODE_DEVICE)
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(2048) STATIC_VAR dcd_data_t dcd_data1;
+#if (CFG_TUSB_CONTROLLER_1_MODE & TUSB_MODE_DEVICE)
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(2048) STATIC_VAR dcd_data_t dcd_data1;
#endif
static LPC_USB0_Type * const LPC_USB[2] = { LPC_USB0, ((LPC_USB0_Type*) LPC_USB1_BASE) };
@@ -138,7 +138,7 @@ static void bus_reset(uint8_t rhport)
//------------- Set up Control Endpoints (0 OUT, 1 IN) -------------//
p_dcd->qhd[0].zero_length_termination = p_dcd->qhd[1].zero_length_termination = 1;
- p_dcd->qhd[0].max_package_size = p_dcd->qhd[1].max_package_size = TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE;
+ p_dcd->qhd[0].max_package_size = p_dcd->qhd[1].max_package_size = CFG_TUSB_DEVICE_CONTROL_ENDOINT_SIZE;
p_dcd->qhd[0].qtd_overlay.next = p_dcd->qhd[1].qtd_overlay.next = QTD_NEXT_INVALID;
p_dcd->qhd[0].int_on_setup = 1; // OUT only
diff --git a/tinyusb/portable/nxp/lpc43xx_lpc18xx/hal_lpc43xx.c b/tinyusb/portable/nxp/lpc43xx_lpc18xx/hal_lpc43xx.c
index 31481b742..34ebb9260 100644
--- a/tinyusb/portable/nxp/lpc43xx_lpc18xx/hal_lpc43xx.c
+++ b/tinyusb/portable/nxp/lpc43xx_lpc18xx/hal_lpc43xx.c
@@ -38,7 +38,7 @@
#include "tusb.h"
-#if TUSB_CFG_MCU == MCU_LPC43XX
+#if CFG_TUSB_MCU == MCU_LPC43XX
#include "LPC43xx.h"
#include "lpc43xx_cgu.h"
@@ -84,7 +84,7 @@ bool tusb_hal_init(void)
LPC_CREG->CREG0 &= ~(1<<5); /* Turn on the phy */
//------------- USB0 -------------//
-#if TUSB_CFG_CONTROLLER_0_MODE
+#if CFG_TUSB_CONTROLLER_0_MODE
CGU_EnableEntity(CGU_CLKSRC_PLL0, DISABLE); /* Disable PLL first */
VERIFY( CGU_ERROR_SUCCESS == CGU_SetPLL0()); /* the usb core require output clock = 480MHz */
CGU_EntityConnect(CGU_CLKSRC_XTAL_OSC, CGU_CLKSRC_PLL0);
@@ -93,29 +93,29 @@ bool tusb_hal_init(void)
// reset controller & set role
hal_controller_reset(0);
- #if TUSB_CFG_CONTROLLER_0_MODE & TUSB_MODE_HOST
+ #if CFG_TUSB_CONTROLLER_0_MODE & TUSB_MODE_HOST
LPC_USB0->USBMODE_H = LPC43XX_USBMODE_HOST | (LPC43XX_USBMODE_VBUS_HIGH << 5);
#else // TODO OTG
LPC_USB0->USBMODE_D = LPC43XX_USBMODE_DEVICE;
LPC_USB0->OTGSC = (1<<3) | (1<<0) /*| (1<<16)| (1<<24)| (1<<25)| (1<<26)| (1<<27)| (1<<28)| (1<<29)| (1<<30)*/;
- #if TUSB_CFG_DEVICE_FULLSPEED // TODO for easy testing
+ #if CFG_TUSB_DEVICE_FULLSPEED // TODO for easy testing
LPC_USB0->PORTSC1_D |= (1<<24); // force full speed
#endif
#endif
#endif
//------------- USB1 -------------//
-#if TUSB_CFG_CONTROLLER_1_MODE
+#if CFG_TUSB_CONTROLLER_1_MODE
// Host require to config P2_5, TODO confirm whether device mode require P2_5 or not
scu_pinmux(0x2, 5, MD_PLN | MD_EZI | MD_ZI, FUNC2); // USB1_VBUS monitor presence, must be high for bus reset occur
/* connect CLK_USB1 to 60 MHz clock */
CGU_EntityConnect(CGU_CLKSRC_PLL1, CGU_BASE_USB1); /* FIXME Run base BASE_USB1_CLK clock from PLL1 (assume PLL1 is 60 MHz, no division required) */
- LPC_SCU->SFSUSB = (TUSB_CFG_CONTROLLER_1_MODE & TUSB_MODE_HOST) ? 0x16 : 0x12; // enable USB1 with on-chip FS PHY
+ LPC_SCU->SFSUSB = (CFG_TUSB_CONTROLLER_1_MODE & TUSB_MODE_HOST) ? 0x16 : 0x12; // enable USB1 with on-chip FS PHY
hal_controller_reset(1);
- #if TUSB_CFG_CONTROLLER_1_MODE & TUSB_MODE_HOST
+ #if CFG_TUSB_CONTROLLER_1_MODE & TUSB_MODE_HOST
LPC_USB1->USBMODE_H = LPC43XX_USBMODE_HOST | (LPC43XX_USBMODE_VBUS_HIGH << 5);
#else // TODO OTG
LPC_USB1->USBMODE_D = LPC43XX_USBMODE_DEVICE;
@@ -129,7 +129,7 @@ bool tusb_hal_init(void)
void hal_dcd_isr(uint8_t rhport);
-#if TUSB_CFG_CONTROLLER_0_MODE
+#if CFG_TUSB_CONTROLLER_0_MODE
void USB0_IRQHandler(void)
{
#if MODE_HOST_SUPPORTED
@@ -142,7 +142,7 @@ void USB0_IRQHandler(void)
}
#endif
-#if TUSB_CFG_CONTROLLER_1_MODE
+#if CFG_TUSB_CONTROLLER_1_MODE
void USB1_IRQHandler(void)
{
#if MODE_HOST_SUPPORTED
diff --git a/tinyusb/tusb.c b/tinyusb/tusb.c
index 2bbba8471..c9d71b1c1 100644
--- a/tinyusb/tusb.c
+++ b/tinyusb/tusb.c
@@ -56,7 +56,7 @@ tusb_error_t tusb_init(void)
return TUSB_ERROR_NONE;
}
-#if TUSB_CFG_OS == TUSB_OS_NONE
+#if CFG_TUSB_OS == TUSB_OS_NONE
void tusb_task(void)
{
#if MODE_HOST_SUPPORTED
@@ -73,7 +73,7 @@ void tusb_task(void)
/*------------------------------------------------------------------*/
/* Debug
*------------------------------------------------------------------*/
-#if TUSB_CFG_DEBUG
+#if CFG_TUSB_DEBUG
char const* const tusb_strerr[TUSB_ERROR_COUNT] =
{
diff --git a/tinyusb/tusb.h b/tinyusb/tusb.h
index 795431cff..9a1fd0c4c 100644
--- a/tinyusb/tusb.h
+++ b/tinyusb/tusb.h
@@ -58,15 +58,15 @@
#include "class/hid/hid_host.h"
#endif
- #if TUSB_CFG_HOST_MSC
+ #if CFG_TUSB_HOST_MSC
#include "class/msc/msc_host.h"
#endif
- #if TUSB_CFG_HOST_CDC
+ #if CFG_TUSB_HOST_CDC
#include "class/cdc/cdc_host.h"
#endif
- #if TUSB_CFG_HOST_CUSTOM_CLASS
+ #if CFG_TUSB_HOST_CUSTOM_CLASS
#include "class/custom_class.h"
#endif
@@ -80,11 +80,11 @@
#include "class/hid/hid_device.h"
#endif
- #if TUSB_CFG_DEVICE_CDC
+ #if CFG_TUSB_DEVICE_CDC
#include "class/cdc/cdc_device.h"
#endif
- #if TUSB_CFG_DEVICE_MSC
+ #if CFG_TUSB_DEVICE_MSC
#include "class/msc/msc_device.h"
#endif
#endif
@@ -102,9 +102,9 @@
*/
tusb_error_t tusb_init(void);
-#if TUSB_CFG_OS == TUSB_OS_NONE
+#if CFG_TUSB_OS == TUSB_OS_NONE
/** \brief Run all tinyusb's internal tasks (e.g host task, device task).
- * \note This function is only required when using no RTOS (\ref TUSB_CFG_OS == TUSB_OS_NONE). All the stack functions
+ * \note This function is only required when using no RTOS (\ref CFG_TUSB_OS == TUSB_OS_NONE). All the stack functions
* & callback are invoked within this function, so it should be called periodically within the mainloop
*
@code
diff --git a/tinyusb/tusb_hal.h b/tinyusb/tusb_hal.h
index 84871f7b7..b8e30851f 100644
--- a/tinyusb/tusb_hal.h
+++ b/tinyusb/tusb_hal.h
@@ -82,11 +82,11 @@ uint32_t tusb_hal_millis(void);
// Enable all ports' interrupt
static inline void tusb_hal_int_enable_all(void)
{
-#ifdef TUSB_CFG_CONTROLLER_0_MODE
+#ifdef CFG_TUSB_CONTROLLER_0_MODE
tusb_hal_int_enable(0);
#endif
-#ifdef TUSB_CFG_CONTROLLER_0_MODE
+#ifdef CFG_TUSB_CONTROLLER_0_MODE
tusb_hal_int_enable(1);
#endif
}
@@ -94,11 +94,11 @@ static inline void tusb_hal_int_enable_all(void)
// Disable all ports' interrupt
static inline void tusb_hal_int_disable_all(void)
{
-#ifdef TUSB_CFG_CONTROLLER_0_MODE
+#ifdef CFG_TUSB_CONTROLLER_0_MODE
tusb_hal_int_disable(0);
#endif
-#ifdef TUSB_CFG_CONTROLLER_0_MODE
+#ifdef CFG_TUSB_CONTROLLER_0_MODE
tusb_hal_int_disable(1);
#endif
}
diff --git a/tinyusb/tusb_option.h b/tinyusb/tusb_option.h
index d17487ba8..a1ce5a273 100644
--- a/tinyusb/tusb_option.h
+++ b/tinyusb/tusb_option.h
@@ -47,7 +47,7 @@
// TODO remove, use vendor specific flag
/** \defgroup group_mcu Supported MCU
- * \ref TUSB_CFG_MCU must be defined to one of these
+ * \ref CFG_TUSB_MCU must be defined to one of these
* @{ */
#define MCU_LPC11UXX 1 ///< NXP LPC11Uxx family
#define MCU_LPC13XX 2 ///< NXP LPC13xx (not supported yet)
@@ -59,11 +59,11 @@
/** @} */
// Allow to use command line to change the config name/location
-#ifndef TUSB_CFG_CONFIG_FILE
- #define TUSB_CFG_CONFIG_FILE "tusb_config.h"
+#ifndef CFG_TUSB_CONFIG_FILE
+ #define CFG_TUSB_CONFIG_FILE "tusb_config.h"
#endif
-#include TUSB_CFG_CONFIG_FILE
+#include CFG_TUSB_CONFIG_FILE
/** \addtogroup group_configuration
* @{ */
@@ -72,34 +72,34 @@
// CONTROLLER
//--------------------------------------------------------------------+
/** \defgroup group_mode Controller Mode Selection
- * \brief TUSB_CFG_CONTROLLER_N_MODE must be defined with these
+ * \brief CFG_TUSB_CONTROLLER_N_MODE must be defined with these
* @{ */
#define TUSB_MODE_HOST 0x02 ///< Host Mode
#define TUSB_MODE_DEVICE 0x01 ///< Device Mode
#define TUSB_MODE_NONE 0x00 ///< Disabled
/** @} */
-#ifndef TUSB_CFG_CONTROLLER_0_MODE
- #define TUSB_CFG_CONTROLLER_0_MODE TUSB_MODE_NONE
+#ifndef CFG_TUSB_CONTROLLER_0_MODE
+ #define CFG_TUSB_CONTROLLER_0_MODE TUSB_MODE_NONE
#endif
-#ifndef TUSB_CFG_CONTROLLER_1_MODE
- #define TUSB_CFG_CONTROLLER_1_MODE TUSB_MODE_NONE
+#ifndef CFG_TUSB_CONTROLLER_1_MODE
+ #define CFG_TUSB_CONTROLLER_1_MODE TUSB_MODE_NONE
#endif
#define CONTROLLER_HOST_NUMBER (\
- ((TUSB_CFG_CONTROLLER_0_MODE & TUSB_MODE_HOST) ? 1 : 0) + \
- ((TUSB_CFG_CONTROLLER_1_MODE & TUSB_MODE_HOST) ? 1 : 0))
+ ((CFG_TUSB_CONTROLLER_0_MODE & TUSB_MODE_HOST) ? 1 : 0) + \
+ ((CFG_TUSB_CONTROLLER_1_MODE & TUSB_MODE_HOST) ? 1 : 0))
#define CONTROLLER_DEVICE_NUMBER (\
- ((TUSB_CFG_CONTROLLER_0_MODE & TUSB_MODE_DEVICE) ? 1 : 0) + \
- ((TUSB_CFG_CONTROLLER_1_MODE & TUSB_MODE_DEVICE) ? 1 : 0))
+ ((CFG_TUSB_CONTROLLER_0_MODE & TUSB_MODE_DEVICE) ? 1 : 0) + \
+ ((CFG_TUSB_CONTROLLER_1_MODE & TUSB_MODE_DEVICE) ? 1 : 0))
#define MODE_HOST_SUPPORTED (CONTROLLER_HOST_NUMBER > 0)
#define MODE_DEVICE_SUPPORTED (CONTROLLER_DEVICE_NUMBER > 0)
#if !MODE_HOST_SUPPORTED && !MODE_DEVICE_SUPPORTED
- #error please configure at least 1 TUSB_CFG_CONTROLLER_N_MODE to TUSB_MODE_HOST and/or TUSB_MODE_DEVICE
+ #error please configure at least 1 CFG_TUSB_CONTROLLER_N_MODE to TUSB_MODE_HOST and/or TUSB_MODE_DEVICE
#endif
//--------------------------------------------------------------------+
@@ -112,26 +112,26 @@
- Level 1: Print out if Assert failed. STATIC_VAR is NULL --> accessible when debugging
- Level 0: no debug information is generated
*/
-#ifndef TUSB_CFG_DEBUG
- #define TUSB_CFG_DEBUG 0
- #warning TUSB_CFG_DEBUG is not defined, default value is 0
+#ifndef CFG_TUSB_DEBUG
+ #define CFG_TUSB_DEBUG 0
+ #warning CFG_TUSB_DEBUG is not defined, default value is 0
#endif
-#ifndef TUSB_CFG_ATTR_USBRAM
- #error TUSB_CFG_ATTR_USBRAM is not defined, please help me know how to place data in accessible RAM for usb controller
+#ifndef CFG_TUSB_ATTR_USBRAM
+ #error CFG_TUSB_ATTR_USBRAM is not defined, please help me know how to place data in accessible RAM for usb controller
#endif
-#ifndef TUSB_CFG_OS
-#define TUSB_CFG_OS TUSB_OS_NONE
+#ifndef CFG_TUSB_OS
+#define CFG_TUSB_OS TUSB_OS_NONE
#endif
-#if (TUSB_CFG_OS != TUSB_OS_NONE) && !defined (TUSB_CFG_OS_TASK_PRIO)
- #error TUSB_CFG_OS_TASK_PRIO need to be defined (hint: use the highest if possible)
+#if (CFG_TUSB_OS != TUSB_OS_NONE) && !defined (CFG_TUSB_OS_TASK_PRIO)
+ #error CFG_TUSB_OS_TASK_PRIO need to be defined (hint: use the highest if possible)
#endif
-//#ifndef TUSB_CFG_CONFIGURATION_MAX
-// #define TUSB_CFG_CONFIGURATION_MAX 1
-// #warning TUSB_CFG_CONFIGURATION_MAX is not defined, default value is 1
+//#ifndef CFG_TUSB_CONFIGURATION_MAX
+// #define CFG_TUSB_CONFIGURATION_MAX 1
+// #warning CFG_TUSB_CONFIGURATION_MAX is not defined, default value is 1
//#endif
#ifndef tu_malloc
@@ -147,24 +147,24 @@
// HOST OPTIONS
//--------------------------------------------------------------------+
#if MODE_HOST_SUPPORTED
- #ifndef TUSB_CFG_HOST_DEVICE_MAX
- #define TUSB_CFG_HOST_DEVICE_MAX 1
- #warning TUSB_CFG_HOST_DEVICE_MAX is not defined, default value is 1
+ #ifndef CFG_TUSB_HOST_DEVICE_MAX
+ #define CFG_TUSB_HOST_DEVICE_MAX 1
+ #warning CFG_TUSB_HOST_DEVICE_MAX is not defined, default value is 1
#endif
//------------- HUB CLASS -------------//
- #if TUSB_CFG_HOST_HUB && (TUSB_CFG_HOST_DEVICE_MAX == 1)
- #error there is no benefit enable hub with max device is 1. Please disable hub or increase TUSB_CFG_HOST_DEVICE_MAX
+ #if CFG_TUSB_HOST_HUB && (CFG_TUSB_HOST_DEVICE_MAX == 1)
+ #error there is no benefit enable hub with max device is 1. Please disable hub or increase CFG_TUSB_HOST_DEVICE_MAX
#endif
//------------- HID CLASS -------------//
- #define HOST_CLASS_HID ( TUSB_CFG_HOST_HID_KEYBOARD + TUSB_CFG_HOST_HID_MOUSE + TUSB_CFG_HOST_HID_GENERIC )
+ #define HOST_CLASS_HID ( CFG_TUSB_HOST_HID_KEYBOARD + CFG_TUSB_HOST_HID_MOUSE + CFG_TUSB_HOST_HID_GENERIC )
// #if HOST_CLASS_HID
// #define HOST_HCD_XFER_INTERRUPT
// #endif
- #ifndef TUSB_CFG_HOST_ENUM_BUFFER_SIZE
- #define TUSB_CFG_HOST_ENUM_BUFFER_SIZE 256
+ #ifndef CFG_TUSB_HOST_ENUM_BUFFER_SIZE
+ #define CFG_TUSB_HOST_ENUM_BUFFER_SIZE 256
#endif
//------------- CLASS -------------//
@@ -175,14 +175,14 @@
//--------------------------------------------------------------------+
#if MODE_DEVICE_SUPPORTED
- #define DEVICE_CLASS_HID ( TUSB_CFG_DEVICE_HID_KEYBOARD + TUSB_CFG_DEVICE_HID_MOUSE + TUSB_CFG_DEVICE_HID_GENERIC )
+ #define DEVICE_CLASS_HID ( CFG_TUSB_DEVICE_HID_KEYBOARD + CFG_TUSB_DEVICE_HID_MOUSE + CFG_TUSB_DEVICE_HID_GENERIC )
- #if TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE > 64
+ #if CFG_TUSB_DEVICE_CONTROL_ENDOINT_SIZE > 64
#error Control Endpoint Max Package Size cannot larger than 64
#endif
- #ifndef TUSB_CFG_DEVICE_ENUM_BUFFER_SIZE
- #define TUSB_CFG_DEVICE_ENUM_BUFFER_SIZE 256
+ #ifndef CFG_TUSB_DEVICE_ENUM_BUFFER_SIZE
+ #define CFG_TUSB_DEVICE_ENUM_BUFFER_SIZE 256
#endif
#endif // MODE_DEVICE_SUPPORTED
diff --git a/vendor/fatfs/ccsbcs.c b/vendor/fatfs/ccsbcs.c
index 51c858b58..5cf0dd503 100644
--- a/vendor/fatfs/ccsbcs.c
+++ b/vendor/fatfs/ccsbcs.c
@@ -27,7 +27,7 @@
#include "ff.h"
-#if TUSB_CFG_HOST_MSC
+#if CFG_TUSB_HOST_MSC
#if _CODE_PAGE == 437
#define _TBLDEF 1
@@ -540,4 +540,4 @@ WCHAR ff_wtoupper ( /* Upper converted character */
return tbl_lower[i] ? tbl_upper[i] : chr;
}
-#endif // TUSB_CFG_HOST_MSC
+#endif // CFG_TUSB_HOST_MSC
diff --git a/vendor/fatfs/diskio.c b/vendor/fatfs/diskio.c
index 130f6860d..ecaccec3e 100644
--- a/vendor/fatfs/diskio.c
+++ b/vendor/fatfs/diskio.c
@@ -38,7 +38,7 @@
#include "tusb.h"
-#if TUSB_CFG_HOST_MSC
+#if CFG_TUSB_HOST_MSC
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
@@ -48,7 +48,7 @@
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
// TODO change it to portable init
-static DSTATUS disk_state[TUSB_CFG_HOST_DEVICE_MAX];
+static DSTATUS disk_state[CFG_TUSB_HOST_DEVICE_MAX];
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
@@ -63,7 +63,7 @@ static DRESULT wait_for_io_complete(uint8_t usb_addr)
while ( tuh_msc_is_busy(usb_addr) )
{
// TODO should have timeout here
- #if TUSB_CFG_OS != TUSB_OS_NONE
+ #if CFG_TUSB_OS != TUSB_OS_NONE
osal_task_delay(10);
#endif
}
@@ -73,7 +73,7 @@ static DRESULT wait_for_io_complete(uint8_t usb_addr)
void diskio_init(void)
{
- memset(disk_state, STA_NOINIT, TUSB_CFG_HOST_DEVICE_MAX);
+ memset(disk_state, STA_NOINIT, CFG_TUSB_HOST_DEVICE_MAX);
}
//pdrv Specifies the physical drive number.
@@ -204,4 +204,4 @@ DWORD get_fattime (void)
return timestamp.value;
}
-#endif // TUSB_CFG_HOST_MSC
+#endif // CFG_TUSB_HOST_MSC
diff --git a/vendor/fatfs/diskio.h b/vendor/fatfs/diskio.h
index ca97e3403..99743538a 100644
--- a/vendor/fatfs/diskio.h
+++ b/vendor/fatfs/diskio.h
@@ -83,7 +83,7 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
static inline bool disk_is_ready(BYTE pdrv);
static inline bool disk_is_ready(BYTE pdrv)
{
- return (pdrv < TUSB_CFG_HOST_DEVICE_MAX) &&
+ return (pdrv < CFG_TUSB_HOST_DEVICE_MAX) &&
( (disk_status(pdrv) & (STA_NOINIT | STA_NODISK)) == 0 );
}
diff --git a/vendor/fatfs/ff.c b/vendor/fatfs/ff.c
index ee2b6c0f7..897965332 100644
--- a/vendor/fatfs/ff.c
+++ b/vendor/fatfs/ff.c
@@ -99,7 +99,7 @@
#include "ff.h" /* FatFs configurations and declarations */
#include "diskio.h" /* Declarations of low level disk I/O functions */
-#if TUSB_CFG_HOST_MSC
+#if CFG_TUSB_HOST_MSC
/*--------------------------------------------------------------------------
Module Private Definitions
@@ -4327,4 +4327,4 @@ int f_printf (
#endif /* !_FS_READONLY */
#endif /* _USE_STRFUNC */
-#endif // TUSB_CFG_HOST_MSC
+#endif // CFG_TUSB_HOST_MSC
diff --git a/vendor/fatfs/ffconf.h b/vendor/fatfs/ffconf.h
index 75c5c15af..bc132d2c3 100644
--- a/vendor/fatfs/ffconf.h
+++ b/vendor/fatfs/ffconf.h
@@ -128,7 +128,7 @@
/ Physical Drive Configurations
/----------------------------------------------------------------------------*/
-#define _VOLUMES TUSB_CFG_HOST_DEVICE_MAX
+#define _VOLUMES CFG_TUSB_HOST_DEVICE_MAX
/* Number of volumes (logical drives) to be used. */
diff --git a/vendor/freertos/FreeRTOSConfig.h b/vendor/freertos/FreeRTOSConfig.h
index fa1707f99..53ce7551a 100644
--- a/vendor/freertos/FreeRTOSConfig.h
+++ b/vendor/freertos/FreeRTOSConfig.h
@@ -4,7 +4,7 @@
//--------------------------------------------------------------------+
// See http://www.freertos.org/a00110.html.
//--------------------------------------------------------------------+
-#if TUSB_CFG_MCU == MCU_LPC43XX
+#if CFG_TUSB_MCU == MCU_LPC43XX
// TODO remove
#include "lpc43xx_cgu.h"
#define configCPU_CLOCK_HZ CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE)