From dc20152afe6d941c762d829a392cb9ad739026a2 Mon Sep 17 00:00:00 2001 From: slush0 Date: Thu, 31 Mar 2016 22:36:49 +0200 Subject: [PATCH] Playground reflects new trezor.ui.display API --- src/main.py | 6 +++--- src/playground/__init__.py | 13 ++++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/main.py b/src/main.py index 76e1d059d..69394f2d3 100644 --- a/src/main.py +++ b/src/main.py @@ -4,9 +4,9 @@ import utime layout.show_send('1BitkeyP2nDd5oa64x7AjvBbbwST54W5Zmx2', 110.126967) -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_end(lambda x, y: print('touch end %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_end(lambda x, y: print('touch end %d %d\n', x, y)) import playground playground.run() diff --git a/src/playground/__init__.py b/src/playground/__init__.py index 0b7193dac..225fddc6c 100644 --- a/src/playground/__init__.py +++ b/src/playground/__init__.py @@ -2,20 +2,15 @@ import sys sys.path.append('lib') -import gc -import utime import logging -# import uasyncio import math -from uasyncio import core - -from TrezorUi import Display +import gc +from uasyncio import core from trezor import ui -from . import utils +from .import utils -d = Display() logging.basicConfig(level=logging.INFO) loop = core.get_event_loop() @@ -33,7 +28,7 @@ def animate(): col %= 0xff 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) yield from core.sleep(0.5)