d/vive_controller: read from usb with timeout

This aligns with the vive HMD driver and fixes high CPU usage.
This commit is contained in:
Christoph Haag 2020-05-07 21:21:19 +02:00
parent dc4dcf15a9
commit aaa2f0a0bd

View file

@ -867,7 +867,8 @@ vive_controller_device_update(struct vive_controller_device *d)
{ {
uint8_t buf[FEATURE_BUFFER_SIZE]; uint8_t buf[FEATURE_BUFFER_SIZE];
do { do {
int ret = os_hid_read(d->controller_hid, buf, sizeof(buf), 0); int ret =
os_hid_read(d->controller_hid, buf, sizeof(buf), 1000);
if (ret < 0) { if (ret < 0) {
return ret; return ret;
} }