Skip to content
Permalink
Browse files

clear input buffer before sending init for lisy

  • Loading branch information...
jabdoa2 committed Jun 16, 2019
1 parent 09159f6 commit 4f1198fd3302ebd1fe8aefa2455056975ac1d065
Showing with 4 additions and 3 deletions.
  1. +4 −3 mpf/platforms/lisy/lisy.py
@@ -230,6 +230,10 @@ def initialize(self):
while True:
# reset platform
self.debug_log("Sending reset.")
# clear buffer
# pylint: disable-msg=protected-access
self._reader._buffer = bytearray()
# send command
self.send_byte(LisyDefines.GeneralReset)
try:
return_code = yield from asyncio.wait_for(self.read_byte(), timeout=0.5,
@@ -240,9 +244,6 @@ def initialize(self):
if return_code != 0:
# reset failed
self.warning_log("Reset of LISY failed. Got %s instead of 0. Will retry.", return_code)
# clear buffer
# pylint: disable-msg=protected-access
self._reader._buffer = bytearray()
continue

# if we made it here reset succeeded

0 comments on commit 4f1198f

Please sign in to comment.
You can’t perform that action at this time.