1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-13 19:18:56 +00:00

Stickuv playground

This commit is contained in:
slush0 2016-05-02 16:50:03 +02:00 committed by Pavol Rusnak
parent 20dad5a300
commit 4a918a4ba0
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
6 changed files with 49 additions and 1 deletions

8
emu_stick.sh Executable file
View File

@ -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

View File

@ -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")

View File

@ -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

Binary file not shown.

8
src/main_stick.py Normal file
View File

@ -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