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:
parent
20dad5a300
commit
4a918a4ba0
8
emu_stick.sh
Executable file
8
emu_stick.sh
Executable 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
|
15
src/apps/playground_stick/__init__.py
Normal file
15
src/apps/playground_stick/__init__.py
Normal 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")
|
17
src/apps/playground_stick/layout_homescreen.py
Normal file
17
src/apps/playground_stick/layout_homescreen.py
Normal 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
|
BIN
src/apps/playground_stick/trezor.toig
Normal file
BIN
src/apps/playground_stick/trezor.toig
Normal file
Binary file not shown.
8
src/main_stick.py
Normal file
8
src/main_stick.py
Normal 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)
|
2
vendor/trezor-crypto
vendored
2
vendor/trezor-crypto
vendored
@ -1 +1 @@
|
||||
Subproject commit 242a5de275d36e2df6792c921a9cd7d8c8e8933b
|
||||
Subproject commit b8ec5567ba701c77379f2111774456eb18b98790
|
Loading…
Reference in New Issue
Block a user