1 /* This tests the case where the hub reports a port ENABLE change. The specific
2    test case is in ux_host_class_hub_port_change_process.c. */
3 
4 #include "usbx_ux_test_hub.h"
5 
6 /* Define what the initial system looks like.  */
7 
8 #ifdef CTEST
test_application_define(void * first_unused_memory)9 void test_application_define(void *first_unused_memory)
10 #else
11 void usbx_hub_port_change_enable_test_application_define(void *first_unused_memory)
12 #endif
13 {
14 
15     /* Inform user.  */
16     printf("Running Hub Port Change Enable Test................................. ");
17 
18     stepinfo("\n");
19 
20     initialize_hub(first_unused_memory);
21 }
22 
post_init_host()23 static void post_init_host()
24 {
25 #if UX_MAX_DEVICES > 1
26     /* Send port change enable to host. */
27     set_and_send_port_event(0,
28                             UX_HOST_CLASS_HUB_PORT_CHANGE_ENABLE);
29 
30     /* Wait for enum thread to complete. */
31     tx_thread_sleep(100);
32     ux_test_wait_for_enum_thread_completion();
33 
34     /* Ensure the port enable was cleared. */
35     UX_TEST_ASSERT((g_hub_device->port_change & UX_HOST_CLASS_HUB_PORT_CHANGE_ENABLE) == 0);
36 #endif
37 }
38 
post_init_device()39 static void post_init_device()
40 {
41 }