1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

firmware: use separate source tree (src1) for T1 app code for now

This commit is contained in:
Pavol Rusnak 2018-10-02 17:32:38 +02:00
parent 0ab0f9e418
commit 96ddcf39df
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 30 additions and 8 deletions

View File

@ -276,14 +276,6 @@ SOURCE_TREZORHAL = [
SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_MICROPYTHON_SPEED SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_MICROPYTHON_SPEED
# TODO: recursive Glob
SOURCE_PY_DIR = 'src/'
SOURCE_PY = Glob(SOURCE_PY_DIR + '*.py')
SOURCE_PY.extend(Glob(SOURCE_PY_DIR+'*/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR+'*/*/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR+'*/*/*/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR+'*/*/*/*/*.py'))
env = Environment(ENV=os.environ, CFLAGS='%s -DPRODUCTION=%s -DPYOPT=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0'), PYOPT)) env = Environment(ENV=os.environ, CFLAGS='%s -DPRODUCTION=%s -DPYOPT=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0'), PYOPT))
env.Tool('micropython') env.Tool('micropython')
@ -385,6 +377,18 @@ env.Ignore(qstr_collected, qstr_generated)
# Frozen modules # Frozen modules
# #
if env.get('TREZOR_MODEL') == '1':
SOURCE_PY_DIR = 'src1/'
else:
SOURCE_PY_DIR = 'src/'
# TODO: recursive Glob
SOURCE_PY = Glob(SOURCE_PY_DIR + '*.py')
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + '*/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + '*/*/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + '*/*/*/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + '*/*/*/*/*.py'))
source_mpy = env.FrozenModule(source=SOURCE_PY, source_dir=SOURCE_PY_DIR) source_mpy = env.FrozenModule(source=SOURCE_PY, source_dir=SOURCE_PY_DIR)
source_mpyc = env.FrozenCFile( source_mpyc = env.FrozenCFile(

18
src1/main.py Normal file
View File

@ -0,0 +1,18 @@
import trezorio as io
from trezorui import Display
d = Display()
d.clear()
d.backlight(255)
i = 0
while True:
d.print('Loop %d\n' % i)
i += 1
r = [0, 0]
if io.poll([io.TOUCH], r, 1000000):
print('TOUCH', r)
else:
print('NOTOUCH')