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

core: fix and use MAKEMODULEDEFS instead of explicit registration

This commit is contained in:
matejcik 2020-04-07 12:02:58 +02:00 committed by matejcik
parent a6976355c3
commit d0f709b8cc
9 changed files with 17 additions and 16 deletions

View File

@ -401,6 +401,7 @@ env.Replace(
PYTHON='python',
MAKEQSTRDATA='$PYTHON vendor/micropython/py/makeqstrdata.py',
MAKEVERSIONHDR='$PYTHON vendor/micropython/py/makeversionhdr.py',
MAKEMODULEDEFS='$PYTHON vendor/micropython/py/makemoduledefs.py',
MPY_TOOL='$PYTHON vendor/micropython/tools/mpy-tool.py',
MPY_CROSS='vendor/micropython/mpy-cross/mpy-cross -O' + PYOPT
)

View File

@ -377,6 +377,7 @@ env.Replace(
PYTHON='python',
MAKEQSTRDATA='$PYTHON vendor/micropython/py/makeqstrdata.py',
MAKEVERSIONHDR='$PYTHON vendor/micropython/py/makeversionhdr.py',
MAKEMODULEDEFS='$PYTHON vendor/micropython/py/makemoduledefs.py',
MPY_TOOL='$PYTHON vendor/micropython/tools/mpy-tool.py',
MPY_CROSS='vendor/micropython/mpy-cross/mpy-cross -O' + PYOPT
)

View File

@ -402,4 +402,7 @@ const mp_obj_module_t mp_module_trezorconfig = {
.globals = (mp_obj_dict_t *)&mp_module_trezorconfig_globals,
};
MP_REGISTER_MODULE(MP_QSTR_trezorconfig, mp_module_trezorconfig,
MICROPY_PY_TREZORCONFIG);
#endif // MICROPY_PY_TREZORCONFIG

View File

@ -110,4 +110,7 @@ const mp_obj_module_t mp_module_trezorcrypto = {
.globals = (mp_obj_dict_t*)&mp_module_trezorcrypto_globals,
};
MP_REGISTER_MODULE(MP_QSTR_trezorcrypto, mp_module_trezorcrypto,
MICROPY_PY_TREZORCRYPTO);
#endif // MICROPY_PY_TREZORCRYPTO

View File

@ -93,4 +93,6 @@ const mp_obj_module_t mp_module_trezorio = {
.globals = (mp_obj_dict_t*)&mp_module_trezorio_globals,
};
MP_REGISTER_MODULE(MP_QSTR_trezorio, mp_module_trezorio, MICROPY_PY_TREZORIO);
#endif // MICROPY_PY_TREZORIO

View File

@ -40,4 +40,6 @@ const mp_obj_module_t mp_module_trezorui = {
.globals = (mp_obj_dict_t*)&mp_module_trezorui_globals,
};
MP_REGISTER_MODULE(MP_QSTR_trezorui, mp_module_trezorui, MICROPY_PY_TREZORUI);
#endif // MICROPY_PY_TREZORUI

View File

@ -146,4 +146,7 @@ const mp_obj_module_t mp_module_trezorutils = {
.globals = (mp_obj_dict_t *)&mp_module_trezorutils_globals,
};
MP_REGISTER_MODULE(MP_QSTR_trezorutils, mp_module_trezorutils,
MICROPY_PY_TREZORUTILS);
#endif // MICROPY_PY_TREZORUTILS

View File

@ -45,3 +45,5 @@ const mp_obj_module_t mp_module_utime = {
.base = {&mp_type_module},
.globals = (mp_obj_dict_t*)&time_module_globals,
};
MP_REGISTER_MODULE(MP_QSTR_utime, mp_module_utime, MICROPY_PY_UTIME_MP_HAL);

View File

@ -163,22 +163,6 @@
// extra built in names to add to the global namespace
#define MICROPY_PORT_BUILTINS
// extra built in modules to add to the list of known ones
extern const struct _mp_obj_module_t mp_module_utime;
extern const struct _mp_obj_module_t mp_module_trezorconfig;
extern const struct _mp_obj_module_t mp_module_trezorcrypto;
extern const struct _mp_obj_module_t mp_module_trezorio;
extern const struct _mp_obj_module_t mp_module_trezorui;
extern const struct _mp_obj_module_t mp_module_trezorutils;
#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_utime) }, \
{ MP_ROM_QSTR(MP_QSTR_trezorconfig), MP_ROM_PTR(&mp_module_trezorconfig) }, \
{ MP_ROM_QSTR(MP_QSTR_trezorcrypto), MP_ROM_PTR(&mp_module_trezorcrypto) }, \
{ MP_ROM_QSTR(MP_QSTR_trezorio), MP_ROM_PTR(&mp_module_trezorio) }, \
{ MP_ROM_QSTR(MP_QSTR_trezorui), MP_ROM_PTR(&mp_module_trezorui) }, \
{ MP_ROM_QSTR(MP_QSTR_trezorutils), MP_ROM_PTR(&mp_module_trezorutils) },
#define MP_STATE_PORT MP_STATE_VM