Skip to content

Commit 0728532

Browse files
committed
zephyr/mpconfigport: Enable import of mpy and a few related features.
Support for importing .mpy files is quite fundamental to MicroPython these days, eg it allows installing more efficient .mpy code via "mip install" (and installing `unittest` only works with the .mpy version because the .py version uses f-strings, which are not enabled on the zephyr port). So enable it generally for use by all boards. As part of this, also enable: - min/max: needed by `micropython/import_mpy_invalid.py`, and widely used - sys.modules: needed by `run-tests.py` to run .mpy tests with --via-mpy - io module: needed to run .mpy tests, and useful for `io.IOBase` - array slice assign: needed to run .mpy tests, and generally useful as a way to do a memory copy. Signed-off-by: Damien George <[email protected]>
1 parent 16b00cd commit 0728532

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ports/zephyr/mpconfigport.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#define MICROPY_HEAP_SIZE (16 * 1024)
3737
#endif
3838

39+
#define MICROPY_PERSISTENT_CODE_LOAD (1)
3940
#define MICROPY_ENABLE_SOURCE_LINE (1)
4041
#define MICROPY_STACK_CHECK (1)
4142
#define MICROPY_ENABLE_GC (1)
@@ -46,7 +47,6 @@
4647
#define MICROPY_PY_ASYNC_AWAIT (0)
4748
#define MICROPY_PY_BUILTINS_BYTES_HEX (1)
4849
#define MICROPY_PY_BUILTINS_FILTER (0)
49-
#define MICROPY_PY_BUILTINS_MIN_MAX (0)
5050
#define MICROPY_PY_BUILTINS_PROPERTY (0)
5151
#define MICROPY_PY_BUILTINS_RANGE_ATTRS (0)
5252
#define MICROPY_PY_BUILTINS_REVERSED (0)
@@ -55,9 +55,9 @@
5555
#define MICROPY_PY_BUILTINS_HELP (1)
5656
#define MICROPY_PY_BUILTINS_HELP_TEXT zephyr_help_text
5757
#define MICROPY_PY_ARRAY (0)
58+
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
5859
#define MICROPY_PY_COLLECTIONS (0)
5960
#define MICROPY_PY_CMATH (0)
60-
#define MICROPY_PY_IO (0)
6161
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
6262
#define MICROPY_PY_MACHINE (1)
6363
#define MICROPY_PY_MACHINE_INCLUDEFILE "ports/zephyr/modmachine.c"
@@ -97,7 +97,6 @@
9797
#define MICROPY_PY_TIME_INCLUDEFILE "ports/zephyr/modtime.c"
9898
#define MICROPY_PY_ZEPHYR (1)
9999
#define MICROPY_PY_ZSENSOR (1)
100-
#define MICROPY_PY_SYS_MODULES (0)
101100
#define MICROPY_PY_SYS_STDFILES (1)
102101
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
103102
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)

0 commit comments

Comments
 (0)