summaryrefslogtreecommitdiff
path: root/src/class/hid
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-04-01 21:11:06 -0700
committerGitHub <[email protected]>2019-04-01 21:11:06 -0700
commit0848c462b3e431a9da42e96537d2b597a4579636 (patch)
tree746d6642e22e3ecf30d4f4c5f830c2a155bb28d7 /src/class/hid
parent86c24b310509a368cc6a9dfbec43ce531e71d598 (diff)
parent2c1072c0aba48a2e6cbe93118c286b7999b0db43 (diff)
Merge pull request #51 from hathach/develop
Add suspend, resume and remote wakeup support
Diffstat (limited to 'src/class/hid')
-rw-r--r--src/class/hid/hid_device.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c
index 3a20a9cc8..5c81a1268 100644
--- a/src/class/hid/hid_device.c
+++ b/src/class/hid/hid_device.c
@@ -107,7 +107,7 @@ static inline hidd_interface_t* get_interface_by_itfnum(uint8_t itf_num)
//--------------------------------------------------------------------+
bool tud_hid_generic_ready(void)
{
- return (_hidd_itf[ITF_IDX_GENERIC].ep_in != 0) && !dcd_edpt_busy(TUD_OPT_RHPORT, _hidd_itf[ITF_IDX_GENERIC].ep_in);
+ return tud_ready() && (_hidd_itf[ITF_IDX_GENERIC].ep_in != 0) && !dcd_edpt_busy(TUD_OPT_RHPORT, _hidd_itf[ITF_IDX_GENERIC].ep_in);
}
bool tud_hid_generic_report(uint8_t report_id, void const* report, uint8_t len)
@@ -265,6 +265,7 @@ void hidd_init(void)
void hidd_reset(uint8_t rhport)
{
+ (void) rhport;
tu_memclr(_hidd_itf, sizeof(_hidd_itf));
#if CFG_TUD_HID_KEYBOARD
@@ -447,6 +448,7 @@ bool hidd_control_request(uint8_t rhport, tusb_control_request_t const * p_reque
// return false to stall control endpoint (e.g Host send non-sense DATA)
bool hidd_control_request_complete(uint8_t rhport, tusb_control_request_t const * p_request)
{
+ (void) rhport;
hidd_interface_t* p_hid = get_interface_by_itfnum( (uint8_t) p_request->wIndex );
TU_ASSERT(p_hid);
@@ -469,6 +471,11 @@ bool hidd_control_request_complete(uint8_t rhport, tusb_control_request_t const
bool hidd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes)
{
// nothing to do
+ (void) rhport;
+ (void) ep_addr;
+ (void) event;
+ (void) xferred_bytes;
+
return true;
}