controller: Fix USB get_input_report on Windows
This commit is contained in:
parent
277eb4ee3b
commit
514198d136
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user