From 08e09afbe3d16ea97b78ba486153a7ea4a750232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20de=20Giessen?= Date: Mon, 12 May 2025 16:24:19 +0200 Subject: [PATCH] utop: Print MicroPython memory info. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniƫl van de Giessen --- micropython/utop/utop.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/micropython/utop/utop.py b/micropython/utop/utop.py index d4e94c94..76fdaade 100644 --- a/micropython/utop/utop.py +++ b/micropython/utop/utop.py @@ -1,3 +1,4 @@ +import micropython import time try: @@ -72,6 +73,12 @@ def top(update_interval_ms=1000, timeout_ms=None, thread_names={}): print("INFO: Platform does not support listing active tasks.\x1b[K") line_count += 1 + print("\x1b[K") + line_count += 1 + print("MicroPython ", end="") + micropython.mem_info() + line_count += 3 + if previous_line_count > line_count: for _ in range(previous_line_count - line_count): print("\x1b[K")