From 8f3f3cea26f03d5c3979dd594ff02e7d6d49da54 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 22 May 2009 13:13:35 +0200 Subject: * tools/trace: - stop dump at end of trace. --- host/proto/proto.py | 4 ++++ tools/trace/tinter/thost.py | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/host/proto/proto.py b/host/proto/proto.py index e5f0af21..8856a584 100644 --- a/host/proto/proto.py +++ b/host/proto/proto.py @@ -150,6 +150,10 @@ class Proto: h = self.handlers[key] h[0] (*(frame.decode (h[1]))) + def flush (self): + """Drop any pending frames.""" + self.send_queue = [ ] + class Frame: def __init__ (self, command = None, fmt = '', *args): diff --git a/tools/trace/tinter/thost.py b/tools/trace/tinter/thost.py index b5c43c0f..aabde424 100644 --- a/tools/trace/tinter/thost.py +++ b/tools/trace/tinter/thost.py @@ -25,8 +25,13 @@ class THost: def __dump_callback (self, *memory): """Callback call on each data reception""" + not_ff = False for i in range(len (memory)): + if memory[i] != 0xff: + not_ff = True self.__memory.append (memory[i]) + if not not_ff: + self.__proto.flush () sys.stderr.write (".") def __trace_present (self, val): @@ -64,7 +69,7 @@ class THost: i -= FLASH_PAGE start_addr = i - end_addr = start_addr + 100 * 16 + end_addr = start_addr + FLASH_PAGE print "Dump memory from address : " + hex(start_addr) + " to " + \ hex(end_addr) -- cgit v1.2.3