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:
parent
9e911605da
commit
adc3516ac6
1
core/.changelog.d/3633.changed
Normal file
1
core/.changelog.d/3633.changed
Normal file
@ -0,0 +1 @@
|
||||
Improved device responsiveness by removing unnecessary screen refreshes.
|
@ -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)
|
||||
|
||||
@ -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:
|
||||
|
@ -60,11 +60,6 @@ else:
|
||||
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:
|
||||
short_sleep = loop.sleep(20)
|
||||
long_sleep = loop.sleep(80)
|
||||
|
Loading…
Reference in New Issue
Block a user