diff options
| author | hathach <[email protected]> | 2013-04-25 17:48:55 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-04-25 17:48:55 +0700 |
| commit | c0104b996e9ea0c5c25861ccf24e0255431a8f9c (patch) | |
| tree | e6bc02cedad783d2c4d771ac4a9633be23b982d5 /tests | |
| parent | 3763e22c9a91e9bb21f9fa3dc5dafc9eea6254b7 (diff) | |
implement hcd_port_speed_get
move port reset & speed detection from isr context to usbh enumeration task
- decrease time in isr significantly from 50 ms to 580us
fix bug with osal_task_delay for freeRTOS buil
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test/host/ehci/test_ehci_isr.c | 6 | ||||
| -rw-r--r-- | tests/test/host/usbh/test_enum_task.c | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/tests/test/host/ehci/test_ehci_isr.c b/tests/test/host/ehci/test_ehci_isr.c index 6e66f99eb..0bd269bac 100644 --- a/tests/test/host/ehci/test_ehci_isr.c +++ b/tests/test/host/ehci/test_ehci_isr.c @@ -68,7 +68,7 @@ void tearDown(void) void test_isr_device_connect_highspeed(void) { - usbh_device_plugged_isr_Expect(hostid, TUSB_SPEED_HIGH); + usbh_device_plugged_isr_Expect(hostid); //------------- Code Under Test -------------// ehci_controller_device_plug(hostid, TUSB_SPEED_HIGH); @@ -76,7 +76,7 @@ void test_isr_device_connect_highspeed(void) void test_isr_device_connect_fullspeed(void) { - usbh_device_plugged_isr_Expect(hostid, TUSB_SPEED_FULL); + usbh_device_plugged_isr_Expect(hostid); //------------- Code Under Test -------------// ehci_controller_device_plug(hostid, TUSB_SPEED_FULL); @@ -84,7 +84,7 @@ void test_isr_device_connect_fullspeed(void) void test_isr_device_connect_slowspeed(void) { - usbh_device_plugged_isr_Expect(hostid, TUSB_SPEED_LOW); + usbh_device_plugged_isr_Expect(hostid); //------------- Code Under Test -------------// ehci_controller_device_plug(hostid, TUSB_SPEED_LOW); diff --git a/tests/test/host/usbh/test_enum_task.c b/tests/test/host/usbh/test_enum_task.c index 6c1fca285..5ba086f22 100644 --- a/tests/test/host/usbh/test_enum_task.c +++ b/tests/test/host/usbh/test_enum_task.c @@ -55,9 +55,10 @@ usbh_enumerate_t const enum_connect = { .core_id = 0, .hub_addr = 0, .hub_port = 0, - .speed = TUSB_SPEED_FULL }; +tusb_speed_t device_speed = TUSB_SPEED_FULL; + void queue_recv_stub (osal_queue_handle_t const queue_hdl, uint32_t *p_data, uint32_t msec, tusb_error_t *p_error, int num_call); void semaphore_wait_success_stub(osal_semaphore_handle_t const sem_hdl, uint32_t msec, tusb_error_t *p_error, int num_call); tusb_error_t control_xfer_stub(uint8_t dev_addr, const tusb_std_request_t * const p_request, uint8_t data[], int num_call); @@ -71,6 +72,8 @@ void setUp(void) hcd_pipe_control_xfer_StubWithCallback(control_xfer_stub); hcd_port_connect_status_ExpectAndReturn(enum_connect.core_id, true); + hcd_port_reset_Expect(enum_connect.core_id); + hcd_port_speed_get_ExpectAndReturn(enum_connect.core_id, device_speed); osal_semaphore_reset_Expect( usbh_devices[0].control.sem_hdl ); hcd_pipe_control_open_ExpectAndReturn(0, 8, TUSB_ERROR_NONE); } |
