1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 17:38:39 +00:00

Playground reflects new trezor.ui.display API

This commit is contained in:
slush0 2016-03-31 22:36:49 +02:00 committed by Pavol Rusnak
parent 971e9f7ff1
commit dc20152afe
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 7 additions and 12 deletions

View File

@ -4,9 +4,9 @@ import utime
layout.show_send('1BitkeyP2nDd5oa64x7AjvBbbwST54W5Zmx2', 110.126967) layout.show_send('1BitkeyP2nDd5oa64x7AjvBbbwST54W5Zmx2', 110.126967)
ui.touch.callback_start(lambda x, y: print('touch start %d %d\n', x, y)) # ui.touch.callback_start(lambda x, y: print('touch start %d %d\n', x, y))
ui.touch.callback_move(lambda x, y: print('touch move %d %d\n', x, y)) # ui.touch.callback_move(lambda x, y: print('touch move %d %d\n', x, y))
ui.touch.callback_end(lambda x, y: print('touch end %d %d\n', x, y)) # ui.touch.callback_end(lambda x, y: print('touch end %d %d\n', x, y))
import playground import playground
playground.run() playground.run()

View File

@ -2,20 +2,15 @@
import sys import sys
sys.path.append('lib') sys.path.append('lib')
import gc
import utime
import logging import logging
# import uasyncio
import math import math
import gc
from uasyncio import core from uasyncio import core
from TrezorUi import Display
from trezor import ui from trezor import ui
from . import utils from .import utils
d = Display()
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)
loop = core.get_event_loop() loop = core.get_event_loop()
@ -33,7 +28,7 @@ def animate():
col %= 0xff col %= 0xff
col += 0x0f col += 0x0f
d.icon(190, 170, f.read(), utils.rgb2color(col, 0, 0), 0xffff) ui.display.icon(190, 170, f.read(), utils.rgb2color(col, 0, 0), 0xffff)
f.seek(0) f.seek(0)
yield from core.sleep(0.5) yield from core.sleep(0.5)