1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-18 12:28:09 +00:00

ui: speed up backlight transitions

This commit is contained in:
Jan Pochyla 2018-01-30 17:56:30 +01:00
parent 36d034d83a
commit 898b33cffb

View File

@ -87,12 +87,12 @@ async def backlight_slide(val: int, delay: int=20000, step: int=1):
current = display.backlight()
for i in range(current, val, -step if current > val else step):
display.backlight(i)
await sleep
yield sleep
def layout(f):
delay = const(1000)
step = const(3)
delay = const(35000) # 35ms
step = const(20)
async def inner(*args, **kwargs):
await backlight_slide(BACKLIGHT_DIM, delay, step)