File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ SRC_C = \
5050 lib/utils/pyexec.c \
5151 lib/libc/string0.c \
5252 lib/mp-readline/readline.c \
53+ $(BUILD ) /_frozen_mpy.c \
5354
5455OBJ = $(PY_O ) $(addprefix $(BUILD ) /, $(SRC_C:.c=.o ) )
5556
5960all : $(BUILD ) /firmware.elf
6061endif
6162
63+ $(BUILD ) /_frozen_mpy.c : frozentest.mpy
64+ $(ECHO ) " MISC freezing bytecode"
65+ $(Q ) ../tools/mpy-tool.py -f -q $(BUILD ) /genhdr/qstrdefs.preprocessed.h -mlongint-impl=none $^ > $@
66+
6267$(BUILD ) /firmware.elf : $(OBJ )
6368 $(ECHO ) " LINK $@ "
6469 $(Q )$(LD ) $(LDFLAGS ) -o $@ $^ $(LIBS )
Original file line number Diff line number Diff line change 1+ print ('uPy' )
2+ print ('a long string that is not interned' )
3+ print ('a string that has unicode αβγ chars' )
4+ print (b'bytes 1234\x01 ' )
5+ print (123456789 )
6+ for i in range (4 ):
7+ print (i )
Original file line number Diff line number Diff line change 33// options to control how Micro Python is built
44
55#define MICROPY_QSTR_BYTES_IN_HASH (1)
6+ #define MICROPY_QSTR_EXTRA_POOL mp_qstr_frozen_const_pool
67#define MICROPY_ALLOC_PATH_MAX (256)
78#define MICROPY_ALLOC_PARSE_CHUNK_INIT (16)
89#define MICROPY_EMIT_X64 (0)
4344#define MICROPY_PY_IO (0)
4445#define MICROPY_PY_STRUCT (0)
4546#define MICROPY_PY_SYS (0)
46- #define MICROPY_MODULE_FROZEN (0 )
47+ #define MICROPY_MODULE_FROZEN_MPY (1 )
4748#define MICROPY_CPYTHON_COMPAT (0)
4849#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
4950#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE)
You can’t perform that action at this time.
0 commit comments