diff --git a/SConscript.firmware b/SConscript.firmware index 0e109dbed7..6a2fd7b7c3 100644 --- a/SConscript.firmware +++ b/SConscript.firmware @@ -276,14 +276,6 @@ SOURCE_TREZORHAL = [ 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.Tool('micropython') @@ -385,6 +377,18 @@ env.Ignore(qstr_collected, qstr_generated) # 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_mpyc = env.FrozenCFile( diff --git a/src1/main.py b/src1/main.py new file mode 100644 index 0000000000..059565a479 --- /dev/null +++ b/src1/main.py @@ -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')