1
Discussion - MCU / 'USBH_HID_get_report()' timeout problem monitoring mouse activity
« on: February 09, 2022, 11:28:03 AM »
Hi,
I'm experimenting with the 'USBH Example HID' example to acquire data from a fast mouse (1ms update rate). Does anyone know a way to read the HID reports in a non-blocking manner? In the example code, the API function 'USBH_HID_get_report()' waits until the HID has something to report, and if there's nothing (for what looks to be 10 seconds) it issues a 'USBH_ERR_TIMEOUT'. I'm unclear where this 10s interval is configured, since the underlying functions appear to define the timeout as 1000ms).
The bottom line is that I'd like to get the data from the mouse as soon as it starts generating it, but the problem with the example code is that on calling 'USBH_HID_get_report()' after a timeout it doesn't respond to mouse activity for another 10 seconds.
Keith
I'm experimenting with the 'USBH Example HID' example to acquire data from a fast mouse (1ms update rate). Does anyone know a way to read the HID reports in a non-blocking manner? In the example code, the API function 'USBH_HID_get_report()' waits until the HID has something to report, and if there's nothing (for what looks to be 10 seconds) it issues a 'USBH_ERR_TIMEOUT'. I'm unclear where this 10s interval is configured, since the underlying functions appear to define the timeout as 1000ms).
The bottom line is that I'd like to get the data from the mouse as soon as it starts generating it, but the problem with the example code is that on calling 'USBH_HID_get_report()' after a timeout it doesn't respond to mouse activity for another 10 seconds.
Keith