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
|
# 2 bytes: report ID and returned value
|
||||||
# We get back the same report ID and 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
|
assert len(data) == 2
|
||||||
return data[1] == 1
|
return data[1] == 1
|
||||||
except OSError:
|
except OSError as ex:
|
||||||
if self.dev is not None:
|
if self.dev is not None:
|
||||||
log.warn(f'USB device lost')
|
log.warning(f'USB device lost')
|
||||||
self.dev = None
|
self.dev = None
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -286,7 +287,7 @@ class HIDValconomyHandler(ValconomyHandler):
|
|||||||
try:
|
try:
|
||||||
self._do(cmd, *vals, fmt=fmt)
|
self._do(cmd, *vals, fmt=fmt)
|
||||||
except OSError as ex:
|
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):
|
def run(self):
|
||||||
while self.running:
|
while self.running:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user