1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

core: log memory info if TREZOR_LOG_MEMORY env is set

This commit is contained in:
Jan Pochyla 2019-05-24 16:27:51 +02:00
parent 9460ac425a
commit 9586358e44
2 changed files with 9 additions and 0 deletions

View File

@ -19,9 +19,11 @@ if __debug__:
TEST = int(uos.getenv("TREZOR_TEST") or "0")
SAVE_SCREEN = int(uos.getenv("TREZOR_SAVE_SCREEN") or "0")
LOG_MEMORY = int(uos.getenv("TREZOR_LOG_MEMORY") or "0")
else:
TEST = 0
SAVE_SCREEN = 0
LOG_MEMORY = 0
def unimport_begin():

View File

@ -18,6 +18,13 @@ def onclose(w):
if not layouts and default_layout:
startdefault(default_layout)
if __debug__:
import micropython
from trezor import utils
if utils.LOG_MEMORY:
micropython.mem_info()
def closedefault():
global default