diff options
| author | hathach <[email protected]> | 2013-11-06 19:55:48 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-11-06 19:55:48 +0700 |
| commit | 9171d106bccf79a47874d183504525e23d3be9ed (patch) | |
| tree | 5626615d0d0e7a93d68efb7c72bc24ae699364cb /tinyusb | |
| parent | 60d444b4521428511fdf7864c9c6e2193f5572b6 (diff) | |
added hid device hidd_isr callback
refractor keyboard dev demo app
Diffstat (limited to 'tinyusb')
| -rw-r--r-- | tinyusb/class/hid_device.c | 19 | ||||
| -rw-r--r-- | tinyusb/class/hid_device.h | 4 |
2 files changed, 20 insertions, 3 deletions
diff --git a/tinyusb/class/hid_device.c b/tinyusb/class/hid_device.c index cbb0bd61c..a82520fed 100644 --- a/tinyusb/class/hid_device.c +++ b/tinyusb/class/hid_device.c @@ -229,7 +229,24 @@ tusb_error_t hidd_open(uint8_t coreid, tusb_descriptor_interface_t const * p_int return TUSB_ERROR_NONE; } -void hidd_isr(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes); +void hidd_isr(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes) +{ +#if TUSB_CFG_DEVICE_HID_KEYBOARD + if ( endpointhandle_is_equal(edpt_hdl, keyboardd_data.ept_handle) ) + { + tusbd_hid_keyboard_isr(edpt_hdl.coreid, event, xferred_bytes); + return; + } +#endif + +#if TUSB_CFG_DEVICE_HID_MOUSE + if ( endpointhandle_is_equal(edpt_hdl, moused_data.ept_handle) ) + { + tusbd_hid_mouse_isr(edpt_hdl.coreid, event, xferred_bytes); + return; + } +#endif +} #if defined(CAP_DEVICE_ROMDRIVER) && TUSB_CFG_DEVICE_USE_ROM_DRIVER #include "device/dcd_nxp_romdriver.h" // TODO remove rom driver dependency diff --git a/tinyusb/class/hid_device.h b/tinyusb/class/hid_device.h index 89e912122..cd2ce7db6 100644 --- a/tinyusb/class/hid_device.h +++ b/tinyusb/class/hid_device.h @@ -87,7 +87,7 @@ tusb_error_t tusbd_hid_keyboard_send(uint8_t coreid, hid_keyboard_report_t const * - TUSB_EVENT_XFER_STALLED : previously scheduled transfer is stalled by device. * \note Application should schedule the next report by calling \ref tusbh_hid_keyboard_get_report within this callback */ -void tusbd_hid_keyboard_isr(uint8_t coreid, tusb_event_t event); +void tusbd_hid_keyboard_isr(uint8_t coreid, tusb_event_t event, uint32_t xferred_bytes); /** @} */ /** @} */ @@ -121,7 +121,7 @@ bool tusbd_hid_mouse_is_busy(uint8_t coreid); */ tusb_error_t tusbd_hid_mouse_send(uint8_t coreid, hid_mouse_report_t const *p_report); -void tusbd_hid_mouse_isr(uint8_t coreid, tusb_event_t event); +void tusbd_hid_mouse_isr(uint8_t coreid, tusb_event_t event, uint32_t xferred_bytes); /** @} */ /** @} */ |
