1 #include <stdio.h> 2 #include "tx_api.h" 3 #include "ux_api.h" 4 #include "ux_system.h" 5 #include "ux_utility.h" 6 #include "ux_hcd_sim_host.h" 7 #include "ux_test.h" 8 #include "ux_host_class_storage.h" 9 #include "ux_test_utility_sim.h" 10 11 static UX_DEVICE device; 12 static UCHAR memory_buffer[4096]; 13 static UX_ENDPOINT endpoint; 14 static UX_DEVICE endpoint_device; 15 static UX_HCD hcd; 16 entry_function(struct UX_HCD_STRUCT * parm1,UINT parm2,VOID * parm3)17static UINT entry_function(struct UX_HCD_STRUCT *parm1, UINT parm2, VOID *parm3) 18 { 19 20 return(UX_SUCCESS); 21 22 } 23 24 #ifdef CTEST test_application_define(void * first_unused_memory)25void test_application_define(void *first_unused_memory) 26 #else 27 void usbx_ux_host_class_stack_device_configuration_reset_coverage_test_application_define(void *first_unused_memory) 28 #endif 29 { 30 31 UINT status = 0; 32 UX_TRANSFER *transfer_request; 33 34 /* Inform user. */ 35 printf("Running USB host stack device configuration Reset Coverage Test .... "); 36 37 ux_system_initialize(memory_buffer, 4096, UX_NULL, 0); 38 39 device.ux_device_state = UX_DEVICE_SELF_POWERED_STATE; 40 41 device.ux_device_packed_configuration = (UCHAR*)_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, 16); 42 43 transfer_request = &device.ux_device_control_endpoint.ux_endpoint_transfer_request; 44 transfer_request->ux_transfer_request_endpoint = &endpoint; 45 endpoint.ux_endpoint_device = &endpoint_device; 46 endpoint_device.ux_device_state = UX_DEVICE_CONFIGURED; 47 endpoint.ux_endpoint_descriptor.bEndpointAddress = 0x7; 48 #if UX_MAX_HCD > 1 49 endpoint_device.ux_device_hcd = &hcd; 50 #else 51 _ux_system_host->ux_system_host_hcd_array = &hcd; 52 #endif 53 hcd.ux_hcd_entry_function = entry_function; 54 55 _ux_host_stack_device_configuration_reset(&device); 56 57 printf("SUCCESS!\n"); 58 59 test_control_return(0); 60 return; 61 } 62