mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-18 13:38:12 +00:00
fix(core): fix backlight fading when changing screens/layouts
[no changelog]
This commit is contained in:
parent
12f87aa01e
commit
14f8e88e01
@ -99,6 +99,7 @@ def backlight_fade(val: int, delay: int = 14000, step: int = 15) -> None:
|
||||
for i in range(current, val, step):
|
||||
display.backlight(i)
|
||||
utime.sleep_us(delay)
|
||||
display.backlight(val)
|
||||
|
||||
|
||||
def header(
|
||||
|
@ -136,7 +136,7 @@ class RustLayout(ui.Layout):
|
||||
|
||||
def _first_paint(self) -> None:
|
||||
# Clear the screen of any leftovers.
|
||||
ui.backlight_fade(ui.style.BACKLIGHT_DIM)
|
||||
ui.backlight_fade(ui.style.BACKLIGHT_NONE)
|
||||
ui.display.clear()
|
||||
self._paint()
|
||||
|
||||
|
@ -6,7 +6,7 @@ from trezor.ui import rgb
|
||||
BACKLIGHT_NORMAL = const(150)
|
||||
BACKLIGHT_LOW = const(45)
|
||||
BACKLIGHT_DIM = const(5)
|
||||
BACKLIGHT_NONE = const(2)
|
||||
BACKLIGHT_NONE = const(0)
|
||||
BACKLIGHT_MAX = const(255)
|
||||
|
||||
# color palette
|
||||
|
Loading…
Reference in New Issue
Block a user