summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJérémy Dufour2009-05-18 13:03:55 +0200
committerJérémy Dufour2009-05-18 13:03:55 +0200
commitabb347789ec6bbef3704c3fb7db96d25015b6487 (patch)
treed13581b0df707c03af4708722c05dcd25f5beb84 /tools
parent734263aa90fa150e1bcfa6bc70d140a35fccdc39 (diff)
* tools/trace:
- find template using script path, - use ttyUSB (dev2) rather than ttyACM (dev), - decode all printf sequence (rather than just %d).
Diffstat (limited to 'tools')
-rw-r--r--tools/trace/tcreator/writer.py5
-rw-r--r--tools/trace/tinter/thost.py2
-rw-r--r--tools/trace/tinter/tinter.py5
3 files changed, 8 insertions, 4 deletions
diff --git a/tools/trace/tcreator/writer.py b/tools/trace/tcreator/writer.py
index eef1de63..8e6d70b3 100644
--- a/tools/trace/tcreator/writer.py
+++ b/tools/trace/tcreator/writer.py
@@ -1,8 +1,11 @@
import sys
import time
+import os
from lib.traceclass import *
+templatedir = os.path.split (__file__)[0]
+
class Writer:
"""Template writer"""
@@ -19,7 +22,7 @@ class Writer:
return string.upper()
def __read_template__ (self, string):
- f = open ('tcreator/template.h', 'r')
+ f = open (templatedir + '/template.h', 'r')
template = f.read()
f.close()
diff --git a/tools/trace/tinter/thost.py b/tools/trace/tinter/thost.py
index 885fbbb3..cdaef554 100644
--- a/tools/trace/tinter/thost.py
+++ b/tools/trace/tinter/thost.py
@@ -19,7 +19,7 @@ def log (x):
class THost:
"""Class to connect to the flash memory."""
def __init__(self):
- self.__proto = Proto (serial.Serial ('/dev/ttyACM0'), time.time, 0.1)
+ self.__proto = Proto (serial.Serial ('/dev/ttyUSB0'), time.time, 0.1)
self.__memory = list()
self.__traces = []
diff --git a/tools/trace/tinter/tinter.py b/tools/trace/tinter/tinter.py
index 855f97da..c38239ea 100644
--- a/tools/trace/tinter/tinter.py
+++ b/tools/trace/tinter/tinter.py
@@ -29,12 +29,13 @@ class TInter:
if cmd < len(events):
e = events[cmd]
string = e.string_get()
+ vals = [ ]
for i in range (0, e.param_nb()):
p = e.param_get(i)
size = p.length()
- val = get_size (memory, size)
+ vals.append (get_size (memory, size))
memory = memory[size:]
- string = string.replace('%d', str(val), 1)
+ string = string % tuple (vals)
if self.__file == None:
print string[1:len(string)-1]