aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-12-05 14:23:27 -0500
committerKevin O'Connor <kevin@koconnor.net>2009-12-05 14:23:27 -0500
commit77443200cff4e921edb3e6eae95710bce718844f (patch)
tree58036173767dc68dc4d4c0b7c5ee807d0acecd32
parenta53ab0076d93ec5989f71d854d27cb73571b80a2 (diff)
downloadseabios-77443200cff4e921edb3e6eae95710bce718844f.tar.gz
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.
-rwxr-xr-xtools/readserial.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/readserial.py b/tools/readserial.py
index fec2811a..4b47b143 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)