adding _mounted_isr & _umounted_isr callback for host keyboard & mouse

remove TUSB_EVENT_INTERFACE_OPEN & TUSB_EVENT_INTERFACE_CLOSE
This commit is contained in:
hathach
2013-07-03 12:46:12 +07:00
parent b0f45b3651
commit 4a8686e868
9 changed files with 49 additions and 29 deletions
@@ -244,7 +244,7 @@ void test_cdc_xfer_pipe_out(void)
{
pipe_handle_t pipe_notification = { .dev_addr = 1, .xfer_type = TUSB_XFER_INTERRUPT };
pipe_handle_t pipe_out = { .dev_addr = 1, .xfer_type = TUSB_XFER_BULK, .index = 0 };
pipe_handle_t pipe_in = { .dev_addr = 1, .xfer_type = TUSB_XFER_BULK, .index = 1 };
pipe_handle_t pipe_in = { .dev_addr = 1, .xfer_type = TUSB_XFER_BULK, .index = 1 };
cdch_data[dev_addr-1].pipe_notification = pipe_notification;
cdch_data[dev_addr-1].pipe_out = pipe_out;
@@ -260,7 +260,7 @@ void test_cdc_xfer_pipe_in(void)
{
pipe_handle_t pipe_notification = { .dev_addr = 1, .xfer_type = TUSB_XFER_INTERRUPT };
pipe_handle_t pipe_out = { .dev_addr = 1, .xfer_type = TUSB_XFER_BULK, .index = 0 };
pipe_handle_t pipe_in = { .dev_addr = 1, .xfer_type = TUSB_XFER_BULK, .index = 1 };
pipe_handle_t pipe_in = { .dev_addr = 1, .xfer_type = TUSB_XFER_BULK, .index = 1 };
cdch_data[dev_addr-1].pipe_notification = pipe_notification;
cdch_data[dev_addr-1].pipe_out = pipe_out;
@@ -60,7 +60,12 @@
//------------- hidh -------------//
void tusbh_hid_keyboard_isr(uint8_t dev_addr, tusb_event_t event) ATTR_WEAK;
void tusbh_hid_keyboard_mounted_isr(uint8_t dev_addr) ATTR_WEAK;
void tusbh_hid_keyboard_unmounted_isr(uint8_t dev_addr) ATTR_WEAK;
void tusbh_hid_mouse_isr(uint8_t dev_addr, tusb_event_t event) ATTR_WEAK;
void tusbh_hid_mouse_mounted_isr(uint8_t dev_addr) ATTR_WEAK;
void tusbh_hid_mouse_unmounted_isr(uint8_t dev_addr) ATTR_WEAK;
#ifdef __cplusplus
}
@@ -145,7 +145,7 @@ void test_keyboard_open_ok(void)
usbh_control_xfer_subtask_StubWithCallback(stub_set_idle_request);
hcd_pipe_open_ExpectAndReturn(dev_addr, p_kdb_endpoint_desc, TUSB_CLASS_HID, pipe_hdl);
tusbh_hid_keyboard_isr_Expect(dev_addr, TUSB_EVENT_INTERFACE_OPEN);
tusbh_hid_keyboard_mounted_isr_Expect(dev_addr);
//------------- Code Under TEST -------------//
TEST_ASSERT_EQUAL(TUSB_ERROR_NONE, hidh_open_subtask(dev_addr, p_kbd_interface_desc, &length));
@@ -134,7 +134,7 @@ void test_mouse_open_ok(void)
usbh_control_xfer_subtask_StubWithCallback(stub_set_idle_request);
hcd_pipe_open_ExpectAndReturn(dev_addr, p_mouse_endpoint_desc, TUSB_CLASS_HID, pipe_hdl);
tusbh_hid_mouse_isr_Expect(dev_addr, TUSB_EVENT_INTERFACE_OPEN);
tusbh_hid_mouse_mounted_isr_Expect(dev_addr);
//------------- Code Under TEST -------------//
TEST_ASSERT_STATUS( hidh_open_subtask(dev_addr, p_mouse_interface_desc, &length));