acassis commented on code in PR #20904:
URL: https://github.com/apache/nuttx/pull/20904#discussion_r4359208108


##########
drivers/usbhost/usbhost_hidmouse.c:
##########
@@ -1446,9 +1458,10 @@ static inline int usbhost_cfgdesc(FAR struct 
usbhost_state_s *priv,
               uinfo("Endpoint descriptor\n");
               DEBUGASSERT(remaining >= USB_SIZEOF_EPDESC);
 
-              /* Check for an interrupt endpoint. */
+              /* Check for an interrupt endpoint of the mouse interface */
 
-              if ((epdesc->attr & USB_EP_ATTR_XFERTYPE_MASK) ==
+              if (ifmatch &&

Review Comment:
   you are right about the "found" variable, but in a composite device like the 
Logitech receiver, the parser only takes the interrupt endpoint of the HID 
mouse interface (EP 0x82). Without that filter it grabs the keyboard's endpoint 
(EP 0x81) and the mouse never gets a report. We can even eliminate that 
"ifmatch" variable from the original code (it was used only on the found), but 
using it as a filter to later check if it is an Interrupt IN endpoint seems 
more clear (sane).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to