From fa52ecfb7965e492c6a1c2a3d7afea2d851930bb Mon Sep 17 00:00:00 2001 From: slush0 Date: Fri, 29 Apr 2016 13:52:02 +0200 Subject: [PATCH] WIP --- src/apps/playground/__init__.py | 4 ---- src/lib/const_delay.py | 1 + src/trezor/main.py | 10 +--------- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/apps/playground/__init__.py b/src/apps/playground/__init__.py index 293e5718a3..95cae38de1 100644 --- a/src/apps/playground/__init__.py +++ b/src/apps/playground/__init__.py @@ -1,13 +1,9 @@ from trezor import loop -from trezor import layout from trezor import ui from trezor.utils import unimport_func def layout_tap_to_confirm(address, amount, currency): - from trezor.main import _main_layout - loop.call_later(5 * 1000000, layout.change(_main_layout())) - ui.display.bar(0, 0, 240, 40, ui.GREEN) ui.display.bar(0, 40, 240, 200, ui.WHITE) diff --git a/src/lib/const_delay.py b/src/lib/const_delay.py index b4ec01257a..0e68e80f45 100644 --- a/src/lib/const_delay.py +++ b/src/lib/const_delay.py @@ -7,6 +7,7 @@ class ConstDelay: self.last_run = utime.ticks_us() def wait(self): + # FIXME - use loop.call_at instead of call_later to avoid multiple time handling delay = 2 * self.delay - (utime.ticks_us() - self.last_run) self.last_run = utime.ticks_us() return Sleep(delay) diff --git a/src/trezor/main.py b/src/trezor/main.py index 29a8635ecf..5cddbdce96 100644 --- a/src/trezor/main.py +++ b/src/trezor/main.py @@ -20,19 +20,11 @@ def perf_info(): yield loop.Sleep(1000000) -_main_layout = None - def run(main_layout): - # ui.touch.start(lambda x, y: print('touch start %d %d\n' % (x, y))) - # ui.touch.move(lambda x, y: print('touch move %d %d\n' % (x, y))) - # ui.touch.end(lambda x, y: print('touch end %d %d\n' % (x, y))) - if __debug__: loop.call_soon(perf_info()) - global _main_layout - _main_layout = main_layout - loop.call_soon(layout.set_main(_main_layout)) + loop.call_soon(layout.set_main(main_layout)) loop.run_forever() loop.close()