controller: Fix USB get_input_report on Windows

This commit is contained in:
Jack O'Sullivan 2024-12-13 17:57:49 +00:00
parent 277eb4ee3b
commit 514198d136

View File

@ -253,12 +253,13 @@ class HIDValconomyHandler(ValconomyHandler):
# 2 bytes: report ID and returned value
# We get back the same report ID and value
data = self.dev.get_input_report(0, 2)
# Set to report size + 1 to satisfy W*ndoze
data = self.dev.get_input_report(0, 65)
assert len(data) == 2
return data[1] == 1
except OSError:
except OSError as ex:
if self.dev is not None:
log.warn(f'USB device lost')
log.warning(f'USB device lost')
self.dev = None
return False
@ -286,7 +287,7 @@ class HIDValconomyHandler(ValconomyHandler):
try:
self._do(cmd, *vals, fmt=fmt)
except OSError as ex:
log.warn(f'USB device lost, state dequeuing stalled')
log.warning(f'USB device lost, state dequeuing stalled')
def run(self):
while self.running: