mass rename TUSB_CFG to CFG_TUSB
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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() );
|
||||
|
||||
|
||||
@@ -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() );
|
||||
|
||||
|
||||
@@ -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() );
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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() );
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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};
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
//}
|
||||
|
||||
@@ -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 -------------//
|
||||
|
||||
@@ -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 -------------//
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user