mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-07 07:12:34 +00:00
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.
This commit is contained in:
parent
da536b81ae
commit
0dd113b898
@ -220,6 +220,8 @@ if __debug__:
|
|||||||
|
|
||||||
async def dispatch_DebugLinkRecordScreen(msg: DebugLinkRecordScreen) -> Success:
|
async def dispatch_DebugLinkRecordScreen(msg: DebugLinkRecordScreen) -> Success:
|
||||||
if msg.target_directory:
|
if msg.target_directory:
|
||||||
|
from trezor import ui
|
||||||
|
|
||||||
# In case emulator is restarted but we still want to record screenshots
|
# 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,
|
# into the same directory as before, we need to increment the refresh index,
|
||||||
# so that the screenshots are not overwritten.
|
# so that the screenshots are not overwritten.
|
||||||
@ -227,6 +229,7 @@ if __debug__:
|
|||||||
REFRESH_INDEX = msg.refresh_index
|
REFRESH_INDEX = msg.refresh_index
|
||||||
storage.save_screen_directory = msg.target_directory
|
storage.save_screen_directory = msg.target_directory
|
||||||
storage.save_screen = True
|
storage.save_screen = True
|
||||||
|
ui.refresh()
|
||||||
else:
|
else:
|
||||||
storage.save_screen = False
|
storage.save_screen = False
|
||||||
display.clear_save() # clear C buffers
|
display.clear_save() # clear C buffers
|
||||||
|
@ -20,9 +20,6 @@ if TYPE_CHECKING:
|
|||||||
AwaitableTask = Task | Awaitable
|
AwaitableTask = Task | Awaitable
|
||||||
Finalizer = Callable[[Task, Any], None]
|
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
|
# tasks scheduled for execution in the future
|
||||||
_queue = utimeq.utimeq(64)
|
_queue = utimeq.utimeq(64)
|
||||||
|
|
||||||
@ -176,8 +173,6 @@ def _step(task: Task, value: Any) -> None:
|
|||||||
else:
|
else:
|
||||||
if __debug__:
|
if __debug__:
|
||||||
log.error(__name__, "unknown syscall: %s", result)
|
log.error(__name__, "unknown syscall: %s", result)
|
||||||
if after_step_hook:
|
|
||||||
after_step_hook()
|
|
||||||
|
|
||||||
|
|
||||||
class Syscall:
|
class Syscall:
|
||||||
|
@ -47,12 +47,6 @@ if __debug__:
|
|||||||
else:
|
else:
|
||||||
refresh = display.refresh # type: ignore [obscured-by-same-name]
|
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
|
# import style later to avoid circular dep
|
||||||
from trezor.ui import style # isort:skip
|
from trezor.ui import style # isort:skip
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user