Skip to content

Commit

Permalink
feat(core): drop support for after-step-hook
Browse files Browse the repository at this point in the history
This was necessary for hooking display.refresh() with the old UI toolkit.
With the new one, we explicitly refresh the display after every paint, so
implicit after-step refresh seems no longer necessary.
  • Loading branch information
matejcik committed Apr 10, 2024
1 parent d0f50fc commit 6489e27
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
5 changes: 0 additions & 5 deletions core/src/trezor/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
AwaitableTask = Task | Awaitable
Finalizer = Callable[[Task, Any], None]

# function to call after every task step
after_step_hook: Callable[[], None] | None = None

# tasks scheduled for execution in the future
_queue = utimeq.utimeq(64)

Expand Down Expand Up @@ -179,8 +176,6 @@ def _step(task: Task, value: Any) -> None:
else:
if __debug__:
log.error(__name__, "unknown syscall: %s", result)
if after_step_hook:
after_step_hook()


class Syscall:
Expand Down
6 changes: 0 additions & 6 deletions core/src/trezor/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ def refresh() -> None:
else:
refresh = display.refresh # type: ignore [obscured-by-same-name]


# in both debug and production, emulator needs to draw the screen explicitly
if utils.EMULATOR or utils.INTERNAL_MODEL in ("T1B1", "T2B1"):
loop.after_step_hook = refresh


# import style later to avoid circular dep
from trezor.ui import style # isort:skip

Expand Down

0 comments on commit 6489e27

Please sign in to comment.