trezor-firmware
trezor-firmware copied to clipboard
UI2: Global layout object
We have already faced several issues, mostly in automated tests, where a race condition arose between two layouts competing for screen time.
The current UI code handles the competition via a "cancellation channel", but that is not 100% stable
With Rust UI, we need a clean way to register and deregister timer events. The way the current code works, all timer events go through the same loop.Timer instance, which means that the same instance can be resumed multiple times, producing highly non-deterministic results unless being handled very carefully.
As an alternative, instead of spawning a handle_timers loop that awaits the timer object, we could schedule timer objects directly on the
(summary tbd)
See also: https://github.com/trezor/trezor-firmware/pull/2227#discussion_r869337119