Skip to content

Commit

Permalink
Merge pull request #69 from vianney/serial-fast-read
Browse files Browse the repository at this point in the history
serialext: Do not sleep when all requested data is read
  • Loading branch information
eblot committed Aug 31, 2017
2 parents e5031cd + f79e2ef commit 25922a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyftdi/serialext/protocol_ftdi.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ def read(self, size=1):
until the requested number of bytes is read."""
data = bytearray()
start = now()
while size > 0:
while True:
buf = self.udev.read_data(size)
data += buf
size -= len(buf)
if size == 0:
break
if self._timeout is not None:
if buf:
break
Expand Down

0 comments on commit 25922a9

Please sign in to comment.