diff options
| author | hathach <[email protected]> | 2013-04-09 03:13:27 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-04-09 03:13:27 +0700 |
| commit | a6cf4f228e3036c4df69066df524b3fde74b271c (patch) | |
| tree | 68635dd493e3b9cdf1c76587cd86701c1f122acb /tinyusb/class/hid_host.c | |
| parent | 11dff6f9789c9765788111d677ec69d1ef1f2ce9 (diff) | |
add tusbh_hid_mouse_isr & tusbh_hid_keyboard_isr callback with xfer_complete & error event
Diffstat (limited to 'tinyusb/class/hid_host.c')
| -rw-r--r-- | tinyusb/class/hid_host.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tinyusb/class/hid_host.c b/tinyusb/class/hid_host.c index 054aefcdd..3668af9c0 100644 --- a/tinyusb/class/hid_host.c +++ b/tinyusb/class/hid_host.c @@ -227,6 +227,10 @@ void hidh_isr(pipe_handle_t pipe_hdl, tusb_event_t event) if ( pipehandle_is_equal(pipe_hdl, keyboard_data[pipe_hdl.dev_addr-1].pipe_hdl) ) { keyboard_data[pipe_hdl.dev_addr-1].status = (event == TUSB_EVENT_XFER_COMPLETE) ? TUSB_INTERFACE_STATUS_COMPLETE : TUSB_INTERFACE_STATUS_ERROR; + if (tusbh_hid_keyboard_isr) + { + tusbh_hid_keyboard_isr(pipe_hdl.dev_addr, 0, event); + } return; } #endif @@ -235,6 +239,11 @@ void hidh_isr(pipe_handle_t pipe_hdl, tusb_event_t event) if ( pipehandle_is_equal(pipe_hdl, mouse_data[pipe_hdl.dev_addr-1].pipe_hdl) ) { mouse_data[pipe_hdl.dev_addr-1].status = (event == TUSB_EVENT_XFER_COMPLETE) ? TUSB_INTERFACE_STATUS_COMPLETE : TUSB_INTERFACE_STATUS_ERROR; + if (tusbh_hid_mouse_isr) + { + tusbh_hid_mouse_isr(pipe_hdl.dev_addr, 0, event); + } + return; } #endif |
