From: Kevin O'Connor Date: Sat, 5 Dec 2009 19:23:27 +0000 (-0500) Subject: Fix timing in readserial.py - use 10 bits per byte. X-Git-Tag: rel-0.5.0~20 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=77443200cff4e921edb3e6eae95710bce718844f;p=seabios.git Fix timing in readserial.py - use 10 bits per byte. There is also a start bit, so 8N1 serial should use 10 bits to a byte. --- diff --git a/tools/readserial.py b/tools/readserial.py index fec2811..4b47b14 100755 --- a/tools/readserial.py +++ b/tools/readserial.py @@ -18,6 +18,9 @@ RESTARTINTERVAL = 60 # Alter timing reports based on how much time would be spent writing # to serial. ADJUSTBAUD = 1 +# Number of bits in a transmitted byte - 8N1 is 1 start bit + 8 data +# bits + 1 stop bit. +BITSPERBYTE = 10 def readserial(infile, logfile, baudrate): lasttime = 0 @@ -54,7 +57,7 @@ def readserial(infile, logfile, baudrate): if isnewline: delta = curtime - starttime if ADJUSTBAUD: - delta -= float(charcount * 9) / baudrate + delta -= float(charcount * BITSPERBYTE) / baudrate out += "%06.3f: " % delta isnewline = 0 oc = ord(c)