feat(core): drop support for after-step-hook

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.
pull/3633/head
matejcik 2 months ago
parent da536b81ae
commit 0dd113b898

@ -220,6 +220,8 @@ if __debug__:
async def dispatch_DebugLinkRecordScreen(msg: DebugLinkRecordScreen) -> Success:
if msg.target_directory:
from trezor import ui
# In case emulator is restarted but we still want to record screenshots
# into the same directory as before, we need to increment the refresh index,
# so that the screenshots are not overwritten.
@ -227,6 +229,7 @@ if __debug__:
REFRESH_INDEX = msg.refresh_index
storage.save_screen_directory = msg.target_directory
storage.save_screen = True
ui.refresh()
else:
storage.save_screen = False
display.clear_save() # clear C buffers

@ -20,9 +20,6 @@ if TYPE_CHECKING:
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)
@ -176,8 +173,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:

@ -47,12 +47,6 @@ if __debug__:
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

Loading…
Cancel
Save