Fix connection fail if fw doesn't send start

Closes #2872
This commit is contained in:
Gina Häußge committed 2018-11-06 14:47:39 +01:00
1 parent 4caf4ef09b
commit 343195477b
2 files changed
+5 -2

No files matched your search

+3
View File
@@ -1299,6 +1299,9 @@ class CountedEvent(object):
else:
self._internal_set(self._counter - 1)
def reset(self):
self.clear(completely=True)
def wait(self, timeout=None):
self._event.wait(timeout)
+2 -2
View File
@@ -2322,7 +2322,7 @@ class MachineCom(object):
def _on_external_reset(self):
# hold queue processing, clear queues and acknowledgements, reset line number and last lines
with self._send_queue.blocked():
self._clear_to_send.clear(completely=True)
self._clear_to_send.reset()
with self._command_queue.blocked():
self._command_queue.clear()
self._send_queue.clear()
@@ -2493,7 +2493,7 @@ class MachineCom(object):
# first hook to succeed wins, but any can pass on to the next
self._changeState(self.STATE_OPEN_SERIAL)
self._serial = serial_obj
self._clear_to_send.clear()
self._clear_to_send.reset()
return True
return False