From 3dab5e7797e58a59576149cfbfc91cf56578d232 Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Mon, 7 Aug 2017 12:04:23 +0200 Subject: [PATCH] scons: cleanup defines --- SConscript.firmware | 10 +++++----- SConscript.unix | 9 +++------ embed/firmware/mpconfigport.h | 4 ++++ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/SConscript.firmware b/SConscript.firmware index ccf23314f9..539873ffe5 100644 --- a/SConscript.firmware +++ b/SConscript.firmware @@ -1,5 +1,7 @@ # pylint: disable=E0602 +import os + CCFLAGS_MOD = '' CPPPATH_MOD = [] CPPDEFINES_MOD = [] @@ -299,7 +301,7 @@ SOURCE_PY.extend(Glob('src/*/*/*/*.py')) SOURCE_PY.extend(Glob('src/*/*/*/*/*.py')) SOURCE_PY_DIR = 'src/' -env = Environment() +env = Environment(ENV=os.environ) env.Tool('micropython') @@ -336,12 +338,10 @@ env.Replace( 'vendor/micropython/lib/cmsis/inc', ] + CPPPATH_MOD, CPPDEFINES=[ - 'MICROPY_MODULE_FROZEN_MPY', - ('MICROPY_QSTR_EXTRA_POOL', 'mp_qstr_frozen_const_pool'), - ('STM32_HAL_H', '""'), - 'STM32F405xx', 'TREZOR_STM32', 'MCU_SERIES_F4', + 'STM32F405xx', + ('STM32_HAL_H', '""'), ] + CPPDEFINES_MOD, ASPPFLAGS='$CFLAGS $CCFLAGS', ) diff --git a/SConscript.unix b/SConscript.unix index 480343973b..a015792f0f 100644 --- a/SConscript.unix +++ b/SConscript.unix @@ -251,22 +251,19 @@ env.Replace( 'vendor/micropython/lib/mp-readline', ] + CPPPATH_MOD, CPPDEFINES=[ - 'MICROPY_USE_READLINE', - 'TREZOR_UNIX', 'UNIX', + 'TREZOR_UNIX', + 'MICROPY_USE_READLINE', ('MP_CONFIGFILE', '\\"embed/unix/mpconfigport.h\\"'), ] + CPPDEFINES_MOD, ASPPFLAGS='$CFLAGS $CCFLAGS', ) env.Replace( PYTHON='python', - PYTHONPATH='vendor/micropython/py', - MAKEQSTRDEFS='$PYTHON vendor/micropython/py/makeqstrdefs.py', MAKEQSTRDATA='$PYTHON vendor/micropython/py/makeqstrdata.py', MAKEVERSIONHDR='$PYTHON vendor/micropython/py/makeversionhdr.py', - MPY_CROSS='vendor/micropython/mpy-cross/mpy-cross', MPY_TOOL='$PYTHON vendor/micropython/tools/mpy-tool.py', - MAKE_FROZEN='$PYTHON vendor/micropython/tools/make-frozen.py', ) + MPY_CROSS='vendor/micropython/mpy-cross/mpy-cross', ) # # Micropython version diff --git a/embed/firmware/mpconfigport.h b/embed/firmware/mpconfigport.h index fe21a218d6..dea590ef45 100644 --- a/embed/firmware/mpconfigport.h +++ b/embed/firmware/mpconfigport.h @@ -31,6 +31,10 @@ #ifndef __INCLUDED_MPCONFIGPORT_H #define __INCLUDED_MPCONFIGPORT_H +// frozen modules +#define MICROPY_MODULE_FROZEN_MPY (1) +#define MICROPY_QSTR_EXTRA_POOL (mp_qstr_frozen_const_pool) + // memory allocation policies #define MICROPY_ALLOC_PATH_MAX (128)