- add control_pipe_status for usbh_device_info_t to reflect the status transfer of control pipe

- fix bug with hcd_port_reset
  + remove regs->portsc_bit.port_enable in the wait loop as device unplugged can cause this to always fails
- correct the timeout for hcd_controll_stop/reset 16 uframes ~ 2 ms
- potentially fix bugs device unplugged when new address is not assigned
This commit is contained in:
hathach
2013-03-23 18:36:43 +07:00
parent 44e09cc397
commit 0c5e0ef0f3
6 changed files with 20 additions and 13 deletions
+3 -3
View File
@@ -131,7 +131,7 @@ pipe_status_t pipe_status_get_stub(pipe_handle_t pipe_hdl, int num_call)
break;
case 1:
return PIPE_STATUS_AVAILABLE;
return PIPE_STATUS_READY;
break;
case 2:
@@ -144,7 +144,7 @@ pipe_status_t pipe_status_get_stub(pipe_handle_t pipe_hdl, int num_call)
break;
default:
return PIPE_STATUS_AVAILABLE;
return PIPE_STATUS_READY;
}
}
@@ -174,7 +174,7 @@ void test_keyboard_get_report_not_available()
TEST_ASSERT_EQUAL(TUSB_ERROR_CLASS_DATA_NOT_AVAILABLE, tusbh_hid_keyboard_get(device_hdl, instance_num, &report));
tusbh_device_status_get_IgnoreAndReturn(TUSB_DEVICE_STATE_CONFIGURED);
usbh_pipe_status_get_IgnoreAndReturn(PIPE_STATUS_AVAILABLE);
usbh_pipe_status_get_IgnoreAndReturn(PIPE_STATUS_READY);
TEST_ASSERT_EQUAL(TUSB_ERROR_CLASS_DATA_NOT_AVAILABLE, tusbh_hid_keyboard_get(device_hdl, instance_num, &report));
}