1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-03-03 08:46:05 +00:00

refactor(core): setup single-place layout selection

[no changelog]
This commit is contained in:
tychovrahe 2023-08-24 12:46:10 +02:00 committed by TychoVrahe
parent b9dbdc7057
commit 3c1236bf82
20 changed files with 105 additions and 63 deletions

View File

@ -380,6 +380,21 @@ env = Environment(ENV=os.environ, CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODU
FEATURES_AVAILABLE = tools.configure_board(TREZOR_MODEL, FEATURES_WANTED, env, CPPDEFINES_HAL, SOURCE_HAL, PATH_HAL) FEATURES_AVAILABLE = tools.configure_board(TREZOR_MODEL, FEATURES_WANTED, env, CPPDEFINES_HAL, SOURCE_HAL, PATH_HAL)
if TREZOR_MODEL in ('T', 'DISC1'):
UI_LAYOUT = 'UI_LAYOUT_TT'
ui_layout_feature = 'model_tt'
elif TREZOR_MODEL in ('1', 'R'):
UI_LAYOUT = 'UI_LAYOUT_TR'
ui_layout_feature = 'model_tr'
else:
raise ValueError('Unknown Trezor model')
if 'sd_card' in FEATURES_AVAILABLE:
SDCARD = True
else:
SDCARD = False
env.Tool('micropython') env.Tool('micropython')
env.Replace( env.Replace(
@ -430,6 +445,7 @@ env.Replace(
'FIRMWARE', 'FIRMWARE',
'TREZOR_MODEL_'+TREZOR_MODEL, 'TREZOR_MODEL_'+TREZOR_MODEL,
'USE_HAL_DRIVER', 'USE_HAL_DRIVER',
UI_LAYOUT,
] + CPPDEFINES_MOD + CPPDEFINES_HAL, ] + CPPDEFINES_MOD + CPPDEFINES_HAL,
ASFLAGS=env.get('ENV')['CPU_ASFLAGS'], ASFLAGS=env.get('ENV')['CPU_ASFLAGS'],
ASPPFLAGS='$CFLAGS $CCFLAGS', ASPPFLAGS='$CFLAGS $CCFLAGS',
@ -518,7 +534,7 @@ if FROZEN:
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/*.py', SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/*.py',
exclude=[ exclude=[
SOURCE_PY_DIR + 'trezor/sdcard.py', SOURCE_PY_DIR + 'trezor/sdcard.py',
] if TREZOR_MODEL not in ('T',) else [] ] if not SDCARD else []
)) ))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/crypto/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/crypto/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/*.py'))
@ -529,27 +545,27 @@ if FROZEN:
SOURCE_PY_DIR + 'trezor/ui/layouts/fido.py', SOURCE_PY_DIR + 'trezor/ui/layouts/fido.py',
] if not EVERYTHING else [] ] if not EVERYTHING else []
)) ))
if TREZOR_MODEL in ('T', 'DISC1'): if UI_LAYOUT == 'UI_LAYOUT_TT':
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/*.py', SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt/*.py',
exclude=[ exclude=[
SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/fido.py', SOURCE_PY_DIR + 'trezor/ui/layouts/tt/fido.py',
] if not EVERYTHING else [] ] if not EVERYTHING else []
)) ))
elif TREZOR_MODEL in ('1', 'R'): elif UI_LAYOUT == 'UI_LAYOUT_TR':
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tr/*.py', SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tr/*.py',
exclude=[ exclude=[
SOURCE_PY_DIR + 'trezor/ui/layouts/tr/fido.py', SOURCE_PY_DIR + 'trezor/ui/layouts/tr/fido.py',
] if not EVERYTHING else [] ] if not EVERYTHING else []
)) ))
else: else:
raise ValueError('Unknown Trezor model') raise ValueError('Unknown layout')
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/wire/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/wire/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'storage/*.py', SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'storage/*.py',
exclude=[ exclude=[
SOURCE_PY_DIR + 'storage/sd_salt.py', SOURCE_PY_DIR + 'storage/sd_salt.py',
] if "sd_card" not in FEATURES_AVAILABLE else [] ] if not SDCARD else []
)) ))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/messages/__init__.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/messages/__init__.py'))
@ -573,14 +589,14 @@ if FROZEN:
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/common/*.py', SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/common/*.py',
exclude=[ exclude=[
SOURCE_PY_DIR + 'apps/common/sdcard.py', SOURCE_PY_DIR + 'apps/common/sdcard.py',
] if "sd_card" not in FEATURES_AVAILABLE else [] ] if not SDCARD else []
)) ))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/debug/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/debug/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/homescreen/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/homescreen/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/management/*.py', SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/management/*.py',
exclude=[ exclude=[
SOURCE_PY_DIR + 'apps/management/sd_protect.py', SOURCE_PY_DIR + 'apps/management/sd_protect.py',
] if 'sd_card' not in FEATURES_AVAILABLE else []) ] if not SDCARD else [])
) )
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/management/*/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/management/*/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/misc/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/misc/*.py'))
@ -645,7 +661,8 @@ if FROZEN:
source_dir=SOURCE_PY_DIR, source_dir=SOURCE_PY_DIR,
bitcoin_only=BITCOIN_ONLY, bitcoin_only=BITCOIN_ONLY,
backlight='backlight' in FEATURES_AVAILABLE, backlight='backlight' in FEATURES_AVAILABLE,
optiga='optiga' in FEATURES_AVAILABLE optiga='optiga' in FEATURES_AVAILABLE,
ui_layout=UI_LAYOUT,
) )
source_mpyc = env.FrozenCFile( source_mpyc = env.FrozenCFile(
@ -681,13 +698,7 @@ def cargo_build():
else: else:
profile = '' profile = ''
# T1 does not have its own Rust feature, it shares it with TR features = ['micropython', 'protobuf', ui_layout_feature]
if TREZOR_MODEL in ('1', 'R'):
model_feature = 'model_tr'
else:
model_feature = 'model_tt'
features = ['micropython', 'protobuf', model_feature]
if BITCOIN_ONLY == '1': if BITCOIN_ONLY == '1':
features.append('bitcoin_only') features.append('bitcoin_only')
features.append('ui') features.append('ui')

View File

@ -387,7 +387,6 @@ SOURCE_UNIX = [
if TREZOR_MODEL in ('T', 'R'): if TREZOR_MODEL in ('T', 'R'):
SOURCE_UNIX += [ SOURCE_UNIX += [
'embed/trezorhal/unix/sbu.c', 'embed/trezorhal/unix/sbu.c',
'embed/trezorhal/unix/sdcard.c',
] ]
if TREZOR_MODEL == 'R': if TREZOR_MODEL == 'R':
@ -424,6 +423,24 @@ else:
env = Environment(ENV=os.environ, CFLAGS='%s -DPYOPT=%s -DBITCOIN_ONLY=%s %s' % (ARGUMENTS.get('CFLAGS', ''), PYOPT, BITCOIN_ONLY, STATIC)) env = Environment(ENV=os.environ, CFLAGS='%s -DPYOPT=%s -DBITCOIN_ONLY=%s %s' % (ARGUMENTS.get('CFLAGS', ''), PYOPT, BITCOIN_ONLY, STATIC))
if TREZOR_MODEL in ('T',):
UI_LAYOUT = 'UI_LAYOUT_TT'
ui_layout_feature = 'model_tt'
elif TREZOR_MODEL in ('1', 'R'):
UI_LAYOUT = 'UI_LAYOUT_TR'
ui_layout_feature = 'model_tr'
else:
raise ValueError('Unknown Trezor model')
if TREZOR_MODEL in ('T',):
SDCARD = True
SOURCE_UNIX += [
'embed/trezorhal/unix/sdcard.c',
]
else:
SDCARD = False
env.Tool('micropython') env.Tool('micropython')
env.Replace( env.Replace(
@ -508,6 +525,7 @@ env.Replace(
'TREZOR_BOARD=\\"boards/board-unix.h\\"', 'TREZOR_BOARD=\\"boards/board-unix.h\\"',
'MCU_TYPE='+CPU_MODEL, 'MCU_TYPE='+CPU_MODEL,
('MP_CONFIGFILE', '\\"embed/unix/mpconfigport.h\\"'), ('MP_CONFIGFILE', '\\"embed/unix/mpconfigport.h\\"'),
UI_LAYOUT,
] + CPPDEFINES_MOD, ] + CPPDEFINES_MOD,
ASPPFLAGS='$CFLAGS $CCFLAGS', ) ASPPFLAGS='$CFLAGS $CCFLAGS', )
@ -599,7 +617,7 @@ if FROZEN:
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/*.py', SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/*.py',
exclude=[ exclude=[
SOURCE_PY_DIR + 'trezor/sdcard.py', SOURCE_PY_DIR + 'trezor/sdcard.py',
] if TREZOR_MODEL not in ('T',) else [] ] if not SDCARD else []
)) ))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/crypto/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/crypto/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/*.py'))
@ -610,27 +628,27 @@ if FROZEN:
SOURCE_PY_DIR + 'trezor/ui/layouts/fido.py', SOURCE_PY_DIR + 'trezor/ui/layouts/fido.py',
] if not EVERYTHING else [] ] if not EVERYTHING else []
)) ))
if TREZOR_MODEL in ('T',): if UI_LAYOUT == 'UI_LAYOUT_TT':
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/*.py', SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt/*.py',
exclude=[ exclude=[
SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/fido.py', SOURCE_PY_DIR + 'trezor/ui/layouts/tt/fido.py',
] if not EVERYTHING else [] ] if not EVERYTHING else []
)) ))
elif TREZOR_MODEL in ('R'): elif UI_LAYOUT == 'UI_LAYOUT_TR':
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tr/*.py', SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tr/*.py',
exclude=[ exclude=[
SOURCE_PY_DIR + 'trezor/ui/layouts/tr/fido.py', SOURCE_PY_DIR + 'trezor/ui/layouts/tr/fido.py',
] if not EVERYTHING else [] ] if not EVERYTHING else []
)) ))
else: else:
raise ValueError('Unknown Trezor model') raise ValueError('Unknown layout')
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/wire/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/wire/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'storage/*.py', SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'storage/*.py',
exclude=[ exclude=[
SOURCE_PY_DIR + 'storage/sd_salt.py', SOURCE_PY_DIR + 'storage/sd_salt.py',
] if TREZOR_MODEL not in ('T',) else [] ] if not SDCARD else []
)) ))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/messages/__init__.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/messages/__init__.py'))
@ -654,14 +672,14 @@ if FROZEN:
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/common/*.py', SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/common/*.py',
exclude=[ exclude=[
SOURCE_PY_DIR + 'apps/common/sdcard.py', SOURCE_PY_DIR + 'apps/common/sdcard.py',
] if TREZOR_MODEL not in ('T',) else [] ] if not SDCARD else []
)) ))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/debug/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/debug/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/homescreen/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/homescreen/*.py'))
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/management/*.py', SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/management/*.py',
exclude=[ exclude=[
SOURCE_PY_DIR + 'apps/management/sd_protect.py', SOURCE_PY_DIR + 'apps/management/sd_protect.py',
] if TREZOR_MODEL not in ('T',) else [] + [ ] if not SDCARD else [] + [
SOURCE_PY_DIR + 'apps/management/authenticate_device.py', SOURCE_PY_DIR + 'apps/management/authenticate_device.py',
] if TREZOR_MODEL not in ('R',) else []) ] if TREZOR_MODEL not in ('R',) else [])
) )
@ -728,7 +746,8 @@ if FROZEN:
source_dir=SOURCE_PY_DIR, source_dir=SOURCE_PY_DIR,
bitcoin_only=BITCOIN_ONLY, bitcoin_only=BITCOIN_ONLY,
backlight=TREZOR_MODEL in ('T',), backlight=TREZOR_MODEL in ('T',),
optiga=TREZOR_MODEL in ('R',) optiga=TREZOR_MODEL in ('R',),
ui_layout=UI_LAYOUT,
) )
source_mpyc = env.FrozenCFile( source_mpyc = env.FrozenCFile(
@ -764,9 +783,7 @@ RUST_LIB = 'trezor_lib'
RUST_LIBPATH = f'{RUST_LIBDIR}/lib{RUST_LIB}.a' RUST_LIBPATH = f'{RUST_LIBDIR}/lib{RUST_LIB}.a'
def cargo_build(): def cargo_build():
# T1 does not have its own Rust feature, it shares it with TR features = ['micropython', 'protobuf', ui_layout_feature]
model_feature = 'model_tr' if TREZOR_MODEL == '1' else f'model_t{TREZOR_MODEL.lower()}'
features = ['micropython', 'protobuf', model_feature]
if BITCOIN_ONLY == '1': if BITCOIN_ONLY == '1':
features.append('bitcoin_only') features.append('bitcoin_only')
features.append('ui') features.append('ui')

View File

@ -292,6 +292,7 @@ STATIC mp_obj_str_t mod_trezorutils_revision_obj = {
/// INTERNAL_MODEL: str /// INTERNAL_MODEL: str
/// EMULATOR: bool /// EMULATOR: bool
/// BITCOIN_ONLY: bool /// BITCOIN_ONLY: bool
/// UI_LAYOUT: str
STATIC const mp_rom_map_elem_t mp_module_trezorutils_globals_table[] = { STATIC const mp_rom_map_elem_t mp_module_trezorutils_globals_table[] = {
{MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_trezorutils)}, {MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_trezorutils)},
@ -345,6 +346,13 @@ STATIC const mp_rom_map_elem_t mp_module_trezorutils_globals_table[] = {
#else #else
{MP_ROM_QSTR(MP_QSTR_BITCOIN_ONLY), mp_const_false}, {MP_ROM_QSTR(MP_QSTR_BITCOIN_ONLY), mp_const_false},
#endif #endif
#ifdef UI_LAYOUT_TT
{MP_ROM_QSTR(MP_QSTR_UI_LAYOUT), MP_ROM_QSTR(MP_QSTR_TT)},
#elif UI_LAYOUT_TR
{MP_ROM_QSTR(MP_QSTR_UI_LAYOUT), MP_ROM_QSTR(MP_QSTR_TR)},
#else
#error Unknown layout
#endif
}; };
STATIC MP_DEFINE_CONST_DICT(mp_module_trezorutils_globals, STATIC MP_DEFINE_CONST_DICT(mp_module_trezorutils_globals,

View File

@ -9,7 +9,7 @@ pub mod dma2d;
mod ffi; mod ffi;
pub mod io; pub mod io;
pub mod random; pub mod random;
#[cfg(feature = "model_tr")] #[cfg(feature = "rgb_led")]
pub mod rgb_led; pub mod rgb_led;
pub mod slip39; pub mod slip39;
pub mod storage; pub mod storage;

View File

@ -98,3 +98,4 @@ MODEL: str
INTERNAL_MODEL: str INTERNAL_MODEL: str
EMULATOR: bool EMULATOR: bool
BITCOIN_ONLY: bool BITCOIN_ONLY: bool
UI_LAYOUT: str

View File

@ -39,6 +39,8 @@ def generate(env):
is_t2b1 = env["TREZOR_MODEL"] == "R" is_t2b1 = env["TREZOR_MODEL"] == "R"
backlight = env["backlight"] backlight = env["backlight"]
optiga = env["optiga"] optiga = env["optiga"]
layout_tt = env["ui_layout"] == "UI_LAYOUT_TT"
layout_tr = env["ui_layout"] == "UI_LAYOUT_TR"
interim = f"{target[:-4]}.i" # replace .mpy with .i interim = f"{target[:-4]}.i" # replace .mpy with .i
sed_scripts = " ".join( sed_scripts = " ".join(
[ [
@ -46,6 +48,8 @@ def generate(env):
rf"-e 's/utils\.BITCOIN_ONLY/{btc_only}/g'", rf"-e 's/utils\.BITCOIN_ONLY/{btc_only}/g'",
rf"-e 's/utils\.USE_BACKLIGHT/{backlight}/g'", rf"-e 's/utils\.USE_BACKLIGHT/{backlight}/g'",
rf"-e 's/utils\.USE_OPTIGA/{optiga}/g'", rf"-e 's/utils\.USE_OPTIGA/{optiga}/g'",
rf"-e 's/utils\.UI_LAYOUT == \"TT\"/{layout_tt}/g'",
rf"-e 's/utils\.UI_LAYOUT == \"TR\"/{layout_tr}/g'",
r"-e 's/if TYPE_CHECKING/if False/'", r"-e 's/if TYPE_CHECKING/if False/'",
r"-e 's/import typing/# \0/'", r"-e 's/import typing/# \0/'",
r"-e '/from typing import (/,/^\s*)/ {s/^/# /}'", r"-e '/from typing import (/,/^\s*)/ {s/^/# /}'",

View File

@ -173,18 +173,18 @@ trezor.ui.layouts.tr.recovery
import trezor.ui.layouts.tr.recovery import trezor.ui.layouts.tr.recovery
trezor.ui.layouts.tr.reset trezor.ui.layouts.tr.reset
import trezor.ui.layouts.tr.reset import trezor.ui.layouts.tr.reset
trezor.ui.layouts.tt_v2 trezor.ui.layouts.tt
import trezor.ui.layouts.tt_v2 import trezor.ui.layouts.tt
trezor.ui.layouts.tt_v2.fido trezor.ui.layouts.tt.fido
import trezor.ui.layouts.tt_v2.fido import trezor.ui.layouts.tt.fido
trezor.ui.layouts.tt_v2.homescreen trezor.ui.layouts.tt.homescreen
import trezor.ui.layouts.tt_v2.homescreen import trezor.ui.layouts.tt.homescreen
trezor.ui.layouts.tt_v2.progress trezor.ui.layouts.tt.progress
import trezor.ui.layouts.tt_v2.progress import trezor.ui.layouts.tt.progress
trezor.ui.layouts.tt_v2.recovery trezor.ui.layouts.tt.recovery
import trezor.ui.layouts.tt_v2.recovery import trezor.ui.layouts.tt.recovery
trezor.ui.layouts.tt_v2.reset trezor.ui.layouts.tt.reset
import trezor.ui.layouts.tt_v2.reset import trezor.ui.layouts.tt.reset
trezor.ui.style trezor.ui.style
import trezor.ui.style import trezor.ui.style
trezor.utils trezor.utils

View File

@ -4,9 +4,9 @@ from .common import * # noqa: F401,F403
# NOTE: using any import magic probably causes mypy not to check equivalence of # NOTE: using any import magic probably causes mypy not to check equivalence of
# layout type signatures across models # layout type signatures across models
if utils.INTERNAL_MODEL in ("T1B1", "T2B1"): if utils.UI_LAYOUT == "TR":
from .tr import * # noqa: F401,F403 from .tr import * # noqa: F401,F403
elif utils.INTERNAL_MODEL in ("T2T1", "D001"): elif utils.UI_LAYOUT == "TT":
from .tt_v2 import * # noqa: F401,F403 from .tt import * # noqa: F401,F403
else: else:
raise ValueError("Unknown Trezor model") raise ValueError("Unknown layout")

View File

@ -1,6 +1,6 @@
from trezor import utils from trezor import utils
if utils.INTERNAL_MODEL in ("T2T1", "D001"): if utils.UI_LAYOUT == "TT":
from .tt_v2.fido import * # noqa: F401,F403 from .tt.fido import * # noqa: F401,F403
elif utils.INTERNAL_MODEL in ("T2B1",): elif utils.UI_LAYOUT == "TR":
from .tr.fido import * # noqa: F401,F403 from .tr.fido import * # noqa: F401,F403

View File

@ -1,6 +1,6 @@
from trezor import utils from trezor import utils
if utils.INTERNAL_MODEL in ("T2T1", "D001"): if utils.UI_LAYOUT == "TT":
from .tt_v2.homescreen import * # noqa: F401,F403 from .tt.homescreen import * # noqa: F401,F403
elif utils.INTERNAL_MODEL in ("T2B1",): elif utils.UI_LAYOUT == "TR":
from .tr.homescreen import * # noqa: F401,F403 from .tr.homescreen import * # noqa: F401,F403

View File

@ -1,6 +1,6 @@
from trezor import utils from trezor import utils
if utils.INTERNAL_MODEL in ("T2T1", "D001"): if utils.UI_LAYOUT == "TT":
from .tt_v2.progress import * # noqa: F401,F403 from .tt.progress import * # noqa: F401,F403
elif utils.INTERNAL_MODEL in ("T2B1",): elif utils.UI_LAYOUT == "TR":
from .tr.progress import * # noqa: F401,F403 from .tr.progress import * # noqa: F401,F403

View File

@ -1,6 +1,6 @@
from trezor import utils from trezor import utils
if utils.INTERNAL_MODEL in ("T2T1", "D001"): if utils.UI_LAYOUT == "TT":
from .tt_v2.recovery import * # noqa: F401,F403 from .tt.recovery import * # noqa: F401,F403
elif utils.INTERNAL_MODEL in ("T2B1",): elif utils.UI_LAYOUT == "TR":
from .tr.recovery import * # noqa: F401,F403 from .tr.recovery import * # noqa: F401,F403

View File

@ -1,6 +1,6 @@
from trezor import utils from trezor import utils
if utils.INTERNAL_MODEL in ("T2T1", "D001"): if utils.UI_LAYOUT == "TT":
from .tt_v2.reset import * # noqa: F401,F403 from .tt.reset import * # noqa: F401,F403
elif utils.INTERNAL_MODEL in ("T2B1",): elif utils.UI_LAYOUT == "TR":
from .tr.reset import * # noqa: F401,F403 from .tr.reset import * # noqa: F401,F403

View File

@ -6,6 +6,7 @@ from trezorutils import ( # noqa: F401
INTERNAL_MODEL, INTERNAL_MODEL,
MODEL, MODEL,
SCM_REVISION, SCM_REVISION,
UI_LAYOUT,
USE_BACKLIGHT, USE_BACKLIGHT,
USE_OPTIGA, USE_OPTIGA,
USE_SD_CARD, USE_SD_CARD,