summaryrefslogtreecommitdiff
path: root/kvmd/plugins/hid/spi.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-11-19 23:28:23 +0300
committerDevaev Maxim <[email protected]>2020-11-20 00:15:18 +0300
commita77db72355c760eb38deb4c46a83fb7d3f2ed008 (patch)
tree208cd060c234fbfd77ef3c1879ed906950660bed /kvmd/plugins/hid/spi.py
parent188de715153100806bc4a95f3888f6f03f1ede2f (diff)
multihid firmware
Diffstat (limited to 'kvmd/plugins/hid/spi.py')
-rw-r--r--kvmd/plugins/hid/spi.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/kvmd/plugins/hid/spi.py b/kvmd/plugins/hid/spi.py
index 7dadac0e..785ca779 100644
--- a/kvmd/plugins/hid/spi.py
+++ b/kvmd/plugins/hid/spi.py
@@ -67,7 +67,7 @@ class _SpiPhyConnection(BasePhyConnection):
assert request[0] == 0x33
deadline_ts = time.monotonic() + self.__read_timeout
- dummy = b"\x00" * 8
+ dummy = b"\x00" * 10
while time.monotonic() < deadline_ts:
if bytes(self.__xfer(dummy)) == dummy:
break
@@ -81,15 +81,15 @@ class _SpiPhyConnection(BasePhyConnection):
deadline_ts = time.monotonic() + self.__read_timeout
found = False
while time.monotonic() < deadline_ts:
- for byte in self.__xfer(b"\x00" * (5 - len(response))):
+ for byte in self.__xfer(b"\x00" * (9 - len(response))):
if not found:
- if byte != 0x33:
+ if byte == 0:
continue
found = True
response.append(byte)
- if len(response) == 4:
+ if len(response) == 8:
break
- if len(response) == 4:
+ if len(response) == 8:
break
else:
get_logger(0).error("SPI timeout reached while responce waiting")