add complete isr for hidh mouse

refractor hid_host.c
- extract hidh_interface_open from hidh_keyboard_open
- extract hidh_interface_close from hidh_keyboard_close
-
This commit is contained in:
hathach
2013-04-07 18:29:30 +07:00
parent 058e2a9837
commit ff63a86a4d
2 changed files with 40 additions and 49 deletions

View File

@@ -178,4 +178,13 @@ void test_mouse_get_ok()
TEST_ASSERT_EQUAL(TUSB_INTERFACE_STATUS_BUSY, tusbh_hid_mouse_status(dev_addr, 0));
}
void test_mouse_isr_event_complete(void)
{
//------------- Code Under TEST -------------//
hidh_isr(p_hidh_mouse->pipe_hdl, TUSB_EVENT_XFER_COMPLETE);
tusbh_device_get_state_IgnoreAndReturn(TUSB_DEVICE_STATE_CONFIGURED);
TEST_ASSERT_EQUAL(TUSB_INTERFACE_STATUS_COMPLETE, tusbh_hid_mouse_status(dev_addr, 0));
}