diff options
| author | hathach <[email protected]> | 2018-04-10 14:31:11 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-04-10 14:31:11 +0700 |
| commit | 3c2467196070eeedd4171e183db04fb815677246 (patch) | |
| tree | 742e3f277776b025ee0f90ab63ef2f70a3b3d03a /tests | |
| parent | 3473c71a6a7cb22cb45f368dba4edda49ed8f7af (diff) | |
mass rename TUSB_CFG to CFG_TUSB
Diffstat (limited to 'tests')
31 files changed, 94 insertions, 94 deletions
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
}
|
