clean up helper func
This commit is contained in:
@@ -51,9 +51,9 @@ extern dcd_dma_descriptor_t dcd_dd[DCD_MAX_DD];
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
memclr_(dcd_udca, 32*4);
|
||||
memclr_(dcd_dd, sizeof(dcd_dma_descriptor_t)*DCD_MAX_DD);
|
||||
memclr_(&lpc_usb, sizeof(LPC_USB_TypeDef));
|
||||
tu_memclr(dcd_udca, 32*4);
|
||||
tu_memclr(dcd_dd, sizeof(dcd_dma_descriptor_t)*DCD_MAX_DD);
|
||||
tu_memclr(&lpc_usb, sizeof(LPC_USB_TypeDef));
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
@@ -129,7 +129,7 @@ void test_dcd_configure_endpoint_in(void)
|
||||
};
|
||||
|
||||
dcd_init();
|
||||
memclr_(&lpc_usb, sizeof(LPC_USB_TypeDef)); // clear to examine register after CUT
|
||||
tu_memclr(&lpc_usb, sizeof(LPC_USB_TypeDef)); // clear to examine register after CUT
|
||||
|
||||
//------------- Code Under Test -------------//
|
||||
dcd_pipe_open(0, &desc_endpoint);
|
||||
|
||||
@@ -71,7 +71,7 @@ void setUp(void)
|
||||
length = 0;
|
||||
dev_addr = 1;
|
||||
|
||||
memclr_(cdch_data, sizeof(cdch_data_t)*CFG_TUSB_HOST_DEVICE_MAX);
|
||||
tu_memclr(cdch_data, sizeof(cdch_data_t)*CFG_TUSB_HOST_DEVICE_MAX);
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
|
||||
@@ -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)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
tu_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 );
|
||||
|
||||
@@ -90,8 +90,8 @@ tusb_desc_endpoint_t const desc_ept_bulk_out =
|
||||
void setUp(void)
|
||||
{
|
||||
ehci_controller_init();
|
||||
memclr_(xfer_data, sizeof(xfer_data));
|
||||
memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
tu_memclr(xfer_data, sizeof(xfer_data));
|
||||
tu_memclr(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
|
||||
TEST_ASSERT_STATUS( hcd_init() );
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ static ehci_qhd_t *p_control_qhd;
|
||||
//--------------------------------------------------------------------+
|
||||
void setUp(void)
|
||||
{
|
||||
memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
tu_memclr(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
|
||||
TEST_ASSERT_STATUS( hcd_init() );
|
||||
|
||||
|
||||
@@ -74,8 +74,8 @@ void setUp(void)
|
||||
{
|
||||
ehci_controller_init();
|
||||
|
||||
memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
memclr_(xfer_data, sizeof(xfer_data));
|
||||
tu_memclr(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
tu_memclr(xfer_data, sizeof(xfer_data));
|
||||
|
||||
TEST_ASSERT_STATUS( hcd_init() );
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ static pipe_handle_t pipe_hdl;
|
||||
//--------------------------------------------------------------------+
|
||||
void setUp(void)
|
||||
{
|
||||
memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
tu_memclr(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
|
||||
hcd_init();
|
||||
|
||||
@@ -78,7 +78,7 @@ void setUp(void)
|
||||
|
||||
period_head_arr = get_period_head( hostid, 1 );
|
||||
p_int_qhd = NULL;
|
||||
memclr_(&pipe_hdl, sizeof(pipe_handle_t));
|
||||
tu_memclr(&pipe_hdl, sizeof(pipe_handle_t));
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
|
||||
@@ -91,8 +91,8 @@ void setUp(void)
|
||||
{
|
||||
ehci_controller_init();
|
||||
|
||||
memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
memclr_(xfer_data, sizeof(xfer_data));
|
||||
tu_memclr(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
tu_memclr(xfer_data, sizeof(xfer_data));
|
||||
|
||||
TEST_ASSERT_STATUS( hcd_init() );
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ static ehci_qhd_t *period_head_arr;
|
||||
//--------------------------------------------------------------------+
|
||||
void setUp(void)
|
||||
{
|
||||
memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
tu_memclr(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
|
||||
hcd_init();
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ tusb_desc_endpoint_t const *p_kdb_endpoint_desc = &desc_configuration.keyboard
|
||||
void setUp(void)
|
||||
{
|
||||
hidh_init();
|
||||
memclr_(&report, sizeof(hid_keyboard_report_t));
|
||||
tu_memclr(&report, sizeof(hid_keyboard_report_t));
|
||||
dev_addr = RANDOM(CFG_TUSB_HOST_DEVICE_MAX)+1;
|
||||
|
||||
p_hidh_kbd = &keyboardh_data[dev_addr-1];
|
||||
|
||||
@@ -62,7 +62,7 @@ void setUp(void)
|
||||
{
|
||||
hidh_init();
|
||||
|
||||
memclr_(&report, sizeof(hid_mouse_report_t));
|
||||
tu_memclr(&report, sizeof(hid_mouse_report_t));
|
||||
dev_addr = RANDOM(CFG_TUSB_HOST_DEVICE_MAX)+1;
|
||||
|
||||
p_hidh_mouse = &mouseh_data[dev_addr-1];
|
||||
|
||||
@@ -73,7 +73,7 @@ enum {
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
memclr_(usbh_devices, sizeof(usbh_device_info_t)*(CFG_TUSB_HOST_DEVICE_MAX+1));
|
||||
tu_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);
|
||||
|
||||
@@ -61,8 +61,8 @@ extern usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
|
||||
//--------------------------------------------------------------------+
|
||||
void ehci_controller_init(void)
|
||||
{
|
||||
memclr_(&lpc_usb0, sizeof(LPC_USB0_Type));
|
||||
memclr_(&lpc_usb1, sizeof(LPC_USB1_Type));
|
||||
tu_memclr(&lpc_usb0, sizeof(LPC_USB0_Type));
|
||||
tu_memclr(&lpc_usb1, sizeof(LPC_USB1_Type));
|
||||
}
|
||||
|
||||
void ehci_controller_control_xfer_proceed(uint8_t dev_addr, uint8_t p_data[])
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
({\
|
||||
uint32_t value=0;\
|
||||
struct_type str;\
|
||||
memclr_((void*)&str, sizeof(struct_type));\
|
||||
tu_memclr((void*)&str, sizeof(struct_type));\
|
||||
str.member.bitfield_member = 1;\
|
||||
memcpy(&value, (void*)&str.member, sizeof(str.member));\
|
||||
tu_log2( value );\
|
||||
@@ -84,7 +84,7 @@
|
||||
#define BITFIELD_OFFSET_OF_UINT32(struct_type, offset, bitfield_member) \
|
||||
({\
|
||||
struct_type str;\
|
||||
memclr_(&str, sizeof(struct_type));\
|
||||
tu_memclr(&str, sizeof(struct_type));\
|
||||
str.bitfield_member = 1;\
|
||||
tu_log2( ((uint32_t*) &str)[offset] );\
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user