host msc built but got hardfault with inquiry command

This commit is contained in:
hathach
2018-12-10 22:06:48 +07:00
parent dffe9b335e
commit 9c3c782b64
6 changed files with 68 additions and 59 deletions
@@ -86,7 +86,7 @@ void test_open_pipe_in_failed(void)
{
hcd_pipe_open_ExpectAndReturn(dev_addr, p_edp_in, TUSB_CLASS_MSC, pipe_null);
TEST_ASSERT(TUSB_ERROR_NONE != msch_open_subtask(dev_addr, p_msc_interface_desc, &length));
TEST_ASSERT(TUSB_ERROR_NONE != msch_open(dev_addr, p_msc_interface_desc, &length));
}
void test_open_pipe_out_failed(void)
@@ -94,7 +94,7 @@ void test_open_pipe_out_failed(void)
hcd_pipe_open_ExpectAndReturn(dev_addr, p_edp_in, TUSB_CLASS_MSC, (pipe_handle_t) {1} );
hcd_pipe_open_ExpectAndReturn(dev_addr, p_edp_out, TUSB_CLASS_MSC, pipe_null);
TEST_ASSERT(TUSB_ERROR_NONE != msch_open_subtask(dev_addr, p_msc_interface_desc, &length));
TEST_ASSERT(TUSB_ERROR_NONE != msch_open(dev_addr, p_msc_interface_desc, &length));
}
tusb_error_t stub_control_xfer(uint8_t dev_addr, uint8_t bmRequestType, uint8_t bRequest,
@@ -129,7 +129,7 @@ void test_open_desc_length(void)
hcd_pipe_queue_xfer_IgnoreAndReturn(TUSB_ERROR_NONE);
//------------- Code Under Test -------------//
TEST_ASSERT_STATUS( msch_open_subtask(dev_addr, p_msc_interface_desc, &length) );
TEST_ASSERT_STATUS( msch_open(dev_addr, p_msc_interface_desc, &length) );
TEST_ASSERT_EQUAL(sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t),
length);
@@ -144,7 +144,7 @@ void test_open_ok(void)
usbh_control_xfer_subtask_StubWithCallback(stub_control_xfer);
//------------- Code Under Test -------------//
TEST_ASSERT_STATUS( msch_open_subtask(dev_addr, p_msc_interface_desc, &length) );
TEST_ASSERT_STATUS( msch_open(dev_addr, p_msc_interface_desc, &length) );
TEST_ASSERT_EQUAL(p_msc_interface_desc->bInterfaceNumber, p_msc->interface_number);
}