1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-15 12:08:59 +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:
matejcik 2024-03-21 13:38:44 +01:00 committed by matejcik
parent 9e911605da
commit adc3516ac6
3 changed files with 1 additions and 10 deletions

View File

@ -0,0 +1 @@
Improved device responsiveness by removing unnecessary screen refreshes.

View File

@ -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)
@ -179,8 +176,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:

View File

@ -60,11 +60,6 @@ else:
refresh = display.refresh refresh = display.refresh
# in both debug and production, emulator needs to draw the screen explicitly
if utils.EMULATOR or utils.INTERNAL_MODEL == "T2B1" or utils.INTERNAL_MODEL == "T3B1":
loop.after_step_hook = refresh
async def _alert(count: int) -> None: async def _alert(count: int) -> None:
short_sleep = loop.sleep(20) short_sleep = loop.sleep(20)
long_sleep = loop.sleep(80) long_sleep = loop.sleep(80)