Mercurial > ~darius > hgwebdir.cgi > pyinst
changeset 23:876d951bbcc0
Redo timeout in a more sensible way (also change it to 100ms)
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Thu, 11 Aug 2011 21:19:10 +0930 |
parents | ef713fe03db8 |
children | 6fe43d62c73b |
files | usb488.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/usb488.py Thu Aug 11 21:18:09 2011 +0930 +++ b/usb488.py Thu Aug 11 21:19:10 2011 +0930 @@ -222,9 +222,12 @@ if wrote != len(chunk): raise "Short write, got %d, expected %d" % (wrote, len(chunk)) - def read(self, timeout = 0.2): + def read(self, timeout = None): """Read data from the device, waits for up to timeout seconds for each USB transaction""" + if timeout == None: + timeout = 0.1 + # Mangle into milliseconds _timeout = int(timeout * 1000.0)