1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-13 02:58:57 +00:00

wip: focus session

This commit is contained in:
matejcik 2024-08-30 11:55:44 +02:00 committed by M1nd3r
parent 19b3e9b845
commit 2f492adbc0
4 changed files with 6 additions and 3 deletions

View File

@ -287,7 +287,7 @@ build_unix: templates ## build unix port
$(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) \
TREZOR_MODEL="$(TREZOR_MODEL)" CMAKELISTS="$(CMAKELISTS)" THP="$(THP)" \
PYOPT="0" BITCOIN_ONLY="$(BITCOIN_ONLY)" TREZOR_EMULATOR_ASAN="$(ADDRESS_SANITIZER)" \
NEW_RENDERING="$(NEW_RENDERING)"
NEW_RENDERING="$(NEW_RENDERING)" TREZOR_MEMPERF="$(TREZOR_MEMPERF)"
build_unix_frozen: templates build_cross ## build unix port with frozen modules
$(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) \

View File

@ -527,7 +527,7 @@ if ARGUMENTS.get('TREZOR_EMULATOR_DEBUGGABLE', '0') == '1':
if ARGUMENTS.get('TREZOR_MEMPERF', '0') == '1':
CPPDEFINES_MOD += [
('MICROPY_TREZOR_MEMPERF', '\(1\)')
('MICROPY_TREZOR_MEMPERF', '1')
]
env.Replace(

View File

@ -64,6 +64,9 @@ async def handle_received_message(
if __debug__:
log.debug(__name__, "handle_received_message")
import micropython
micropython.mem_info()
print(micropython.alloc_count())
ctrl_byte, _, payload_length = ustruct.unpack(">BHH", message_buffer)
message_length = payload_length + INIT_HEADER_LENGTH

View File

@ -102,7 +102,7 @@ class Emulator:
return os.environ.copy()
def _get_transport(self) -> UdpTransport:
return UdpTransport(f"127.0.0.1:{self.port}")
return UdpTransport(f"127.0.0.1:{self.port}", skip_protocol_detection=True)
def wait_until_ready(self, timeout: float = EMULATOR_WAIT_TIME) -> None:
assert self.process is not None, "Emulator not started"