diff options
author | Damien George <damien@micropython.org> | 2025-06-23 13:01:33 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-07-08 11:15:11 +1000 |
commit | 07285323cf68435db86b3e736a714a487464dceb (patch) | |
tree | 2a90cefdd7459fe07376b47b7a1127ab2313ae1c | |
parent | 16b00cd6e78d9afc9f5c3930939fdae0d60dfb78 (diff) |
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 <damien@micropython.org>
-rw-r--r-- | ports/zephyr/mpconfigport.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ports/zephyr/mpconfigport.h b/ports/zephyr/mpconfigport.h index 1ab838ad9..a24caf745 100644 --- a/ports/zephyr/mpconfigport.h +++ b/ports/zephyr/mpconfigport.h @@ -36,6 +36,7 @@ #define MICROPY_HEAP_SIZE (16 * 1024) #endif +#define MICROPY_PERSISTENT_CODE_LOAD (1) #define MICROPY_ENABLE_SOURCE_LINE (1) #define MICROPY_STACK_CHECK (1) #define MICROPY_ENABLE_GC (1) @@ -46,7 +47,6 @@ #define MICROPY_PY_ASYNC_AWAIT (0) #define MICROPY_PY_BUILTINS_BYTES_HEX (1) #define MICROPY_PY_BUILTINS_FILTER (0) -#define MICROPY_PY_BUILTINS_MIN_MAX (0) #define MICROPY_PY_BUILTINS_PROPERTY (0) #define MICROPY_PY_BUILTINS_RANGE_ATTRS (0) #define MICROPY_PY_BUILTINS_REVERSED (0) @@ -55,9 +55,9 @@ #define MICROPY_PY_BUILTINS_HELP (1) #define MICROPY_PY_BUILTINS_HELP_TEXT zephyr_help_text #define MICROPY_PY_ARRAY (0) +#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1) #define MICROPY_PY_COLLECTIONS (0) #define MICROPY_PY_CMATH (0) -#define MICROPY_PY_IO (0) #define MICROPY_PY_MICROPYTHON_MEM_INFO (1) #define MICROPY_PY_MACHINE (1) #define MICROPY_PY_MACHINE_INCLUDEFILE "ports/zephyr/modmachine.c" @@ -97,7 +97,6 @@ #define MICROPY_PY_TIME_INCLUDEFILE "ports/zephyr/modtime.c" #define MICROPY_PY_ZEPHYR (1) #define MICROPY_PY_ZSENSOR (1) -#define MICROPY_PY_SYS_MODULES (0) #define MICROPY_PY_SYS_STDFILES (1) #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) |