Stickuv playground

pull/25/head
slush0 8 years ago committed by Pavol Rusnak
parent 20dad5a300
commit 4a918a4ba0
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -0,0 +1,8 @@
#!/bin/bash
cd `dirname $0`/src
if [ "$1" == -d ]; then
shift
gdb --args ../vendor/micropython/unix/micropython $* -O0 -X heapsize=100000 main_stick.py
else
../vendor/micropython/unix/micropython $* -O0 -X heapsize=100000 main_stick.py
fi

@ -0,0 +1,15 @@
# Every application is supposed to have two entry points:
#
# boot() is called during device boot time and it should prepare
# all global things necessary to run.
#
# dispatch() is called once event subscribed in boot() is received.
def dispatch():
# Callback for HID messages
print("Dispatch homescreen")
def boot():
# Initilize app on boot time.
# This should hookup HID message types dispatcher() wants to receive.
print("Stickova appka")

@ -0,0 +1,17 @@
from trezor import ui
from trezor import loop
def layout_homescreen():
# ui.display.bar(0, 0, 240, 240, ui.WHITE)
f = open('apps/playground_stick/trezor.toig', 'r')
def func(foreground):
f.seek(0)
ui.display.icon(0, 0, f.read(), foreground, ui.BLACK)
animation = ui.animate_pulse(func, ui.WHITE, ui.GREY, speed=400000)
yield from animation

@ -0,0 +1,8 @@
import trezor.main
from apps import playground_stick
playground_stick.boot()
from apps.playground_stick import layout_homescreen
# Run main even loop and specify, which screen is default
trezor.main.run(main_layout=layout_homescreen.layout_homescreen)

@ -1 +1 @@
Subproject commit 242a5de275d36e2df6792c921a9cd7d8c8e8933b
Subproject commit b8ec5567ba701c77379f2111774456eb18b98790
Loading…
Cancel
Save