mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-18 13:38:12 +00:00
ui: speed up backlight transitions
This commit is contained in:
parent
36d034d83a
commit
898b33cffb
@ -87,12 +87,12 @@ async def backlight_slide(val: int, delay: int=20000, step: int=1):
|
|||||||
current = display.backlight()
|
current = display.backlight()
|
||||||
for i in range(current, val, -step if current > val else step):
|
for i in range(current, val, -step if current > val else step):
|
||||||
display.backlight(i)
|
display.backlight(i)
|
||||||
await sleep
|
yield sleep
|
||||||
|
|
||||||
|
|
||||||
def layout(f):
|
def layout(f):
|
||||||
delay = const(1000)
|
delay = const(35000) # 35ms
|
||||||
step = const(3)
|
step = const(20)
|
||||||
|
|
||||||
async def inner(*args, **kwargs):
|
async def inner(*args, **kwargs):
|
||||||
await backlight_slide(BACKLIGHT_DIM, delay, step)
|
await backlight_slide(BACKLIGHT_DIM, delay, step)
|
||||||
|
Loading…
Reference in New Issue
Block a user