Skip to content

Commit 1569852

Browse files
Improve About info
1 parent 0bb7835 commit 1569852

File tree

1 file changed

+9
-6
lines changed
  • internal_filesystem/builtin/apps/com.micropythonos.about/assets

1 file changed

+9
-6
lines changed

internal_filesystem/builtin/apps/com.micropythonos.about/assets/about.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,20 @@ def onCreate(self):
2929
label15.set_text(f"sys.path: {sys.path}")
3030
import micropython
3131
label16 = lv.label(screen)
32-
label16.set_text(f"micropython.mem_info(): {micropython.mem_info()}")
32+
label16.set_text(f"micropython.opt_level(): {micropython.opt_level()}")
33+
import gc
3334
label17 = lv.label(screen)
34-
label17.set_text(f"micropython.opt_level(): {micropython.opt_level()}")
35-
label18 = lv.label(screen)
36-
label18.set_text(f"micropython.qstr_info(): {micropython.qstr_info()}")
35+
label17.set_text(f"Memory: {gc.mem_free()} free, {gc.mem_alloc()} allocated, {gc.mem_alloc()+gc.mem_free()} total")
36+
# These are always written to sys.stdout
37+
#label16.set_text(f"micropython.mem_info(): {micropython.mem_info()}")
38+
#label18 = lv.label(screen)
39+
#label18.set_text(f"micropython.qstr_info(): {micropython.qstr_info()}")
3740
label19 = lv.label(screen)
3841
label19.set_text(f"mpos.__path__: {mpos.__path__}") # this will show .frozen if the /lib folder is frozen (prod build)
3942
try:
43+
from esp32 import Partition
4044
label5 = lv.label(screen)
4145
label5.set_text("") # otherwise it will show the default "Text" if there's an exception below
42-
from esp32 import Partition
4346
current = Partition(Partition.RUNNING)
4447
label5.set_text(f"Partition.RUNNING: {current}")
4548
next_partition = current.get_next_update()
@@ -49,9 +52,9 @@ def onCreate(self):
4952
print(f"Partition info got exception: {e}")
5053
try:
5154
print("Trying to find out additional board info, not available on every platform...")
55+
import machine
5256
label7 = lv.label(screen)
5357
label7.set_text("") # otherwise it will show the default "Text" if there's an exception below
54-
import machine
5558
label7.set_text(f"machine.freq: {machine.freq()}")
5659
label8 = lv.label(screen)
5760
label8.set_text(f"machine.unique_id(): {machine.unique_id()}")

0 commit comments

Comments
 (0)