From abb347789ec6bbef3704c3fb7db96d25015b6487 Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Mon, 18 May 2009 13:03:55 +0200 Subject: * tools/trace: - find template using script path, - use ttyUSB (dev2) rather than ttyACM (dev), - decode all printf sequence (rather than just %d). --- tools/trace/tcreator/writer.py | 5 ++++- tools/trace/tinter/thost.py | 2 +- tools/trace/tinter/tinter.py | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'tools/trace') 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] -- cgit v1.2.3