diff options
| author | Nathan Conrad <[email protected]> | 2019-09-20 08:56:46 -0400 |
|---|---|---|
| committer | Nathan Conrad <[email protected]> | 2019-09-20 08:56:46 -0400 |
| commit | f241ff389f9494836cdc45e621726c0b69b8daed (patch) | |
| tree | 8643da7c134a48c0caad0c946fdfbe977b4a77bc | |
| parent | a8a65d6ceae244971405a13bc493ee923861be1f (diff) | |
Also need to just return false in the case that it isn't an interface control event. We shouldn't assert. This normally isn't an
error, either, so I don't want to use TU_VERIFY.
| -rw-r--r-- | src/class/hid/hid_device.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c index fee44e30c..b57d6219f 100644 --- a/src/class/hid/hid_device.c +++ b/src/class/hid/hid_device.c @@ -193,6 +193,10 @@ bool hidd_open(uint8_t rhport, tusb_desc_interface_t const * desc_itf, uint16_t // return false to stall control endpoint (e.g unsupported request)
bool hidd_control_request(uint8_t rhport, tusb_control_request_t const * p_request)
{
+ if (p_request->bmRequestType_bit.recipient != TUSB_REQ_RCPT_INTERFACE)
+ {
+ return false;
+ }
hidd_interface_t* p_hid = get_interface_by_itfnum( (uint8_t) p_request->wIndex );
TU_ASSERT(p_hid);
|
