From b2487f9f4102d97e9087742a02d97eb1354a73c7 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Thu, 15 Feb 2024 15:55:49 +0100 Subject: cat.py: it's counter freq, not cpu freq --- script/cat.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/cat.py b/script/cat.py index 330669e..5a9dbff 100755 --- a/script/cat.py +++ b/script/cat.py @@ -6,7 +6,7 @@ import serial.threaded import sys import time -cpu_freq = None +counter_freq = None timer_overflow = None @@ -81,12 +81,12 @@ class SerialMonitor: def handle_line(line): - if cpu_freq is not None: + if counter_freq is not None: print_line = line for match in re.finditer("(\d+)/(\d+) cycles", line): cycles = int(match.group(1)) overflows = int(match.group(2)) - ms = (cycles + timer_overflow * overflows) * 1000 / cpu_freq + ms = (cycles + timer_overflow * overflows) * 1000 / counter_freq match_line = f"{cycles}/{overflows} cycles" new_line = f"{ms} ms ({cycles}/{overflows} cycles)" print_line = re.sub(match_line, new_line, print_line) @@ -100,9 +100,9 @@ if __name__ == "__main__": baud = int(sys.argv[2]) if len(sys.argv) > 4: - cpu_freq = int(sys.argv[3]) + counter_freq = int(sys.argv[3]) timer_overflow = int(sys.argv[4]) monitor = SerialMonitor(tty, baud, handle_line) - time.sleep(5) + time.sleep(20) monitor.close() -- cgit v1.2.3